Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81056
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2014-11-19 22:40 -0800 |
| Message-ID | <5811dc65-d05a-4e29-96de-eb1e4fd8aa4d@googlegroups.com> (permalink) |
| Subject | Beginner |
| From | Karthik Reddy <challakarthik@gmail.com> |
Hi all
I am python beginner I am trying the below code and getting incorrect syntax in python (3.3.2)
number = 23
running = True
while running:
guess = int(raw_input('Enter an integer : '))
if guess == number:
print ("Congratulations, you guessed it.")
running = False # this causes the while loop to stop
elif guess < number:
print ("No, it is a little higher than that.")
else:
print ("No, it is a little lower than that.")
else:
print ("The while loop is over.")
# Do anything else you want to do here
print ("Done")
Please help me with this
Thank you in advance
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Beginner Karthik Reddy <challakarthik@gmail.com> - 2014-11-19 22:40 -0800 Re: Beginner Steven D'Aprano <steve@pearwood.info> - 2014-11-20 06:47 +0000 Re: Beginner Karthik Reddy <challakarthik@gmail.com> - 2014-11-20 23:11 -0800
csiph-web