Wednesday, November 14, 2012

30 Days For my "30 day challenge", I have decided to study the programming language python. This language can be used along with an interpreter to create programs with many different functions. I have no prior experience in programming, so I may need to practice with more simple programs, such as C, C++, or html, until I understand all of the concepts and vocabulary required to learn such a thing. I chose to use python as my language, because there are a series of tutorial videos for the language that I have come across before, but never watched, because I had no experience, but as soon as I thought of programming, I remembered the tutorials and decided to use python. So far, I have watched a multitude of videos on the subject, that teach me basic commands and terms, such as strings, which allow you to create text, and how to add numbers and perform simple operations. I have also written, along with the help of the tutorial, a simple factorial program, which allows me to multiply all of the terms in a certain range, by the preceeding number. For example: 10! or 10 factorial, would be 1*2*3*4*5*6*7*8*9*10. These numbers are stored in a range of range(11), because it excludes the final number (enter 10 in the program). The result would be 3628800. number=eval(input("enter a non-negative integer to take the factorial of: ")) product=1 for i in range(number): product=product*(i+1) print(product)

No comments:

Post a Comment