python code

Amit Nepal amit at amitnepal.com
Mon Apr 13 12:36:53 MST 2015


Sorry ,  I meant this, like Jason mentioned the input prompt must be 
inside the while loop in order for it to wait for the user input :

print("Welcome.")
g = input("Guess the number: ")
     guess = int(g)

while guess != 5
     print("Guess again.")
     g = input("Guess the number: ")
     guess = int(g)
     print("Correct")

*Thanks
Amit
*
On 4/13/2015 12:21 PM, Michael Havens wrote:
> print("Welcome.")
> g = input("Guess the number: ")
> guess = int(g)
>
> while guess != 5
>     print("Guess again.")
>     guess = int(g)
>     print("Correct")

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phxlinux.org/pipermail/plug-discuss/attachments/20150413/e629e6f4/attachment.html>


More information about the PLUG-discuss mailing list