CS270 Blog

Proposal For Medium Level Python Project

For my mid-sized Python Program, I propose that I work with random int generators, raw input from the user, loops, and printingAll of these are heavily used in just about every programming language. Why not learn how to program them in Python?

Here’s a plan:

This Python program will ask the user for his/her name. After taking raw input from the user, it will randomly generate a number between 1-20. The program will print “I’m thinking of a number between 1-20.”

While the number of guesses made are less than 6, the program will print “Take a guess: ”. Each time the users inputs the incorrect number the number of guesses made thus far are stored and incremented. If the user’s guess is less than the actual number, the program prints “Your guess is too low.” If the user’s guess is more than the actual number, the program prints “Your guess is too high”.

If the user guesses the correct number, the program prints “Good job (whatever the user’s name is)! You guessed my number in (however many) guesses!” If the user guesses the wrong number 6 times, the program prints “”Nope. The number I was thinking of was {whatever the randomly-generated number is)”. The program terminates.



  1. cedriccs270blog posted this
To Tumblr, Love PixelUnion