-
March 20th, 2009 06:26 AM
#1
Junior Member
Python Syntax Question
if shape == 1
height = input("Please enter the height")
width = input("Please enter the width")
area = height*width
print "The area is", area
else:
radius = input("Please enter the radius")
area = 3.14*(radius**2)
print "The area is", area
This is the part I get an syntax error with, any ideas?
Thanks in advance
-
March 21st, 2009 08:00 PM
#2
Junior Member
No answers yet? Is this a programming/hacking site or what?
Could someone point me to a better forum for these type question please?
-
March 22nd, 2009 05:30 AM
#3
That second post was definitely unnecessarily snappy.
There are problems with your code, but they could also be problems on the use side
Issues:
1) No ':' at the end of your if statement
2) No use of whitespace to indicate code sections.
Potential user issue:
1) input will only accept numeric entries. If the person typed a letter, a syntax error would be thrown.
IT Blog: .:Computer Defense:.
PnCHd (Pronounced Pinched): Acronym - Point 'n Click Hacked. As in: "That website was pinched" or "The skiddie pinched my computer because I forgot to patch".
-
March 23rd, 2009 04:45 AM
#4
Junior Member
Sorry for being snappy
Thanks it was just a simple :!
The whitespace problem was due to the cut & paste.
Whats a good site to cut & paste code/save it etc?
-
March 23rd, 2009 04:58 AM
#5
 Originally Posted by cranoo
Sorry for being snappy
Thanks it was just a simple :!
The whitespace problem was due to the cut & paste.
Whats a good site to cut & paste code/save it etc?
Similar Threads
-
By Ennis in forum Newbie Security Questions
Replies: 14
Last Post: May 26th, 2011, 01:49 AM
-
By Negative in forum The Security Tutorials Forum
Replies: 12
Last Post: June 2nd, 2004, 01:09 AM
-
By Ennis in forum AntiOnline's General Chit Chat
Replies: 5
Last Post: December 27th, 2003, 04:28 PM
-
By hexadecimal in forum AntiOnline's General Chit Chat
Replies: 10
Last Post: September 13th, 2003, 02:43 AM
-
By smirc in forum AntiOnline's General Chit Chat
Replies: 3
Last Post: May 13th, 2002, 03:24 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks