Thread: Python Trouble
View Single Post
Old 08-17-2006, 10:37 PM   #3 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,721
redhead is on a distinguished road
Quote:
Come on! I need help here!
And I need to wake up after an all nite hacking spree

First of, you're using raw_input() this is for inputting strings, so your value to compare will be a type integer compared with a read string, so I'd suggest you use input() instead of raw_input()

Second, you're using the assignment operator for comparing c1 with your read value, this will not go.. so use
Code:
if c1 == 1:
this would make your program look like this:
Code:
#!/usr/bin/python

print "Welcome to the conversion calculator!"
print """
Please make a choise from the following options

1. Temperatures
2. Distance Rate and Time
"""

c1 = input("Please type the number of your choise : ")
if c1 == 1:
  print "You have selected temperatures"
And May I say, learning python as the first language of choice is a wise move... I'm glad to see that approach from you melvin
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote