Hey, everybody, I'm a newbie at Python (2.7.1), and new to DaniWeb as well. and the apparent simplicity of Python got me interested in programming (seriously, the only thing before this was HTML).
Anyway...
I was taking a test and thought that after I was finished I could make an equation calculator. I've got a few simple equations slapped on there, for proof-of-concept, and they work fine. However, I would like to go back to the user input line of code. How do I go about doing this? I've Googled it, and there's no "goto" function like there is in C, I guess.
Well, here's the code.
print "Equations"
print "a+1 (1), a+2 (2), a+3 (3), a+4 (4)"
d=raw_input("choose equation")
while d:
if d == "1":
print "a+1"
e = input("enter a")
print e + 1
if d == "2":
print "a+2"
e = input("enter a")
print f + 2
if d == "3":
print "a+3"
e = input("enter a")
print g + 3
if d == "4":
print "a+4"
e = input("enter a")
print g + 4
Remember, guys, totally a newb.