Begniner Question
Vishnu
vishnu at acmet.com
Tue Mar 22 02:31:32 EST 2005
>if int(choice)==2:
>else:
> pass
if int(choice)==2:
print "Here" # <== There should be some statement present after the
# if condition. Likewise place this statement in
# all other if conditions
else:
pass
HTH,
Vishnu
-----Original Message-----
From: python-list-bounces+vishnu=acmet.com at python.org
[mailto:python-list-bounces+vishnu=acmet.com at python.org] On Behalf Of
Glen
Sent: Tuesday, March 22, 2005 12:44 PM
To: python-list at python.org
Subject: Begniner Question
#!/usr/local/bin/python
import sys
print "1.\tDo Something"
print "2.\tDo Something"
print "3.\tDo Something"
print "4.\tDo Something"
print "5.\tDo Something"
print "6.\tExit"
choice=raw_input("Please Enter Choice: ")
if int(choice)==1:
print "Here"
else:
pass
if int(choice)==2:
else:
pass
if int(choice)==3:
else:
pass
if int(choice)==4:
else:
pass
if int(choice)==5:
else:
pass
if int(choice)==6:
sys.exit(0)
else:
pass
File "./Code.py", line 20
else:
^
IndentationError: expeted an indented block
What am I doing wrong?
Thank-you
--
http://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list