Too much to do

I’ve mentioned before that I haven’t been bored in decades. Anyway, I’ve been watching Khan Academy’s videos on Python (review: C+) and here’s the first little doodle I’ve made that resembles a program:

number = input(“\nEnter a non-negative integer and I’ll tell you its factorial: “)

product = 1
for step in range(number):
product = product * (step + 1)

print(product)
print “\n”

Example console output:

li@li-Lenovo-G560:~/py$ python fact.py

Enter a non-negative integer and I’ll tell you its factorial: 20
2432902008176640000

So that was pretty fun. But I’m more interested in string/list manipulation, so that’s the direction I’ll be headed once I get through this basic stuff.

Advertisements

About Aeoli Pera

Maybe do this later?
This entry was posted in Uncategorized. Bookmark the permalink.

1 Response to Too much to do

  1. anonymous says:

    Why don’t you try landoflisp/SICP?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s