Re: How do I make my code jump back to a previous line? Programming by Dani Organizing code into functions is always important for readability and also to be able to reuse parts of your code as your app gets bigger. Thank you for posting your updated code to share with others :) How do I make my code jump back to a previous line? Programming by trueriver …;2": print("Shutting down...") sys.exit() elif sysInfo.lower() == "3": if admin == True… time.sleep(1) print("New password set!") elif sysInfo.lower() == "5": if admin ==… Re: How do I make my code jump back to a previous line? Programming by trueriver …"2": print("Shutting down...") sys.exit() elif sysInfo.lower() == "3": if admin == True:… newUserPassword time.sleep(1) print("New password set!") elif sysInfo.lower() == "5": if admin == True… Re: How do I make my code jump back to a previous line? Programming by woooee if sysInfo.lower() in ["exit", "Exit", "EXIT"]: since sysinfo is now lower(), it will never be equal to "Exit" or "EXIT" Re: Cannot run exe from asp.net Programming Web Development by lennyli …decode('utf-8') if command.lower() == 'exit': break elif command.startswith('move'): _, x, y = command.split…() pyautogui.moveTo(int(x), int(y)) elif command == 'click': pyautogui.click() elif command.startswith('type'): _, text = command.split… elif error, i really have no clue where this is coming from Programming Software Development by gotm …== 5): print "White is the winner!" return True elif (whitePairCap == 5): print "Black is the winner!" …if (color == "b"): currentPlayers[p] = "black" elif (color == "w"): currentPlayers[p] = "white" inGameMenu… Re: elif error, i really have no clue where this is coming from Programming Software Development by gotm … = str(saveFile) if saveFile == "y": saveFileGame() elif saveFile == "n": newGame() #defining players and their colors… (color == "b"): currentPlayers[p] = "black" elif (color == "w"): currentPlayers[p] = "white" … Re: elif error, i really have no clue where this is coming from Programming Software Development by gotm …quot;White is the winner!" return True elif (whitePairCap == 5): print "Black is …[8],line[9]]) f.close() inGameMenu() elif saveFile == "n": newGame() …quot;b"): currentPlayers[p] = "black" elif (color == "w"): currentPlayers[p] = "… Re: elif error, i really have no clue where this is coming from Programming Software Development by Gribouillis [icode]elif[/icode] and [icode]else[/icode] must have the same indentation than the corresponding [icode]if[/icode]. Edit: sorry, in your code, the 2 lines before the elif should be indented like the for statement above. Re: elif error, i really have no clue where this is coming from Programming Software Development by woooee [QUOTE]Ugh I hate these elif errors![/QUOTE]Then don't use it. Some examples that … range(0, 10): row_dic[j] = [] ## ##------------------------------------------------------------------ """ instead of elif (player == "p2"):, etc. """ player_dic = {} player_dic… elif problem Programming Software Development by Russ775 …1: print("You are gonna die today") input() elif fortune == 2: print("You will find love") input…print("You will make it big today!") input() elif fortune == 4: print("You friends will betray you!&…quot;) input() elif fortune == 5: print("They are comming to find you… Re: elif problem Programming Software Development by JoshuaBurleson … == 1: print("You are gonna die today") elif fortune == 2: print("You will find love"… 3: print("You will make it big today!") elif fortune == 4: print("You friends will betray you!"…;) elif fortune == 5: print("They are comming to find you… elif structure Programming Software Development by tondeuse34 … and i try to use an elif statement and run the code, it say's 'elif' is an syntax error. Is it… way do you want to go(L,R,S)?: ") elif direction == 'L': print "You have gone left."[/CODE… Re: elif structure Programming Software Development by MitkOK …;) if direction == 'Left': print "You have gone left" elif direction == 'Right': print "You have gone right" else… "You have gone Straight" [/code] You indented "elif" in manner to check the first input [code="… Re: elif structure Programming Software Development by MitkOK Yes, it's indention problem. [code="python"] print "1) Play" if choice == 1: ways = ['L','R','S'] ways = raw_input("Which way do you want to go(L,R,S)?: ") elif direction == 'L': print "You have gone left." [/code] Re: elif structure Programming Software Development by tondeuse34 … way do you want to go('Left,Right,Straight)?: ") elif direction == 'Left': print "You have gone left"[/CODE… if / elif Programming Software Development by lewashby … self.boredom if unhappiness < 5: mood = "happy" elif 5 <= unhappiness <= 10: mood = "okay"… =="2": crit.eat() # play with your critter elif choice == "3": crit.play() # some unknown choice else:… Re: if / elif Programming Software Development by masterofpuppets …<= 10[/CODE] is the same thing as [CODE]elif 5 <= unhappiness and unhappiness <= 10[/CODE]…the input inside the while loop and all if..elif should be inside as well. Like this: […quot;2": crit.eat() # play with your critter elif choice == "3": crit.play() # some … Help with updating a list inside a elif clause and return the list Programming Software Development by anishxx323 …that the scores are being updated in the elif clause but once i get out the clause…scores has been cleared") elif option == 1: scores.append(addScores()) elif option == 2: printScores() elif option == 3: averageScores() … Re: if, else, elif.. newb. Programming Software Development by woooee …2: as the first if, and the following elif's should use and elif shipweight >2 and shipweight <6: … like a list. You eliminate a long string of elif, and you can simply modify the list to add/…change/delete weight catagories. (No additional elif necessary if another catagory is added.)[CODE]def shipping_charges(package_weight… if, else, elif.. newb. Programming Software Development by SitiSlicker …2: print 'Your total shipping charges: $2.10' elif: if shipweight>2 or shipweight<6: print… some random errors. but it always tells me 'elif' or 'else' are invalid syntax.. haha maybe … looking for a little clarification on the if, elif and else structure. Any constructive input is greatly … Help with if , elif statement Programming Software Development by rociel …start before and end before 9pm. payment =(end - start)*5 elif start <= 21 and end <= 3: # if … after = (24 + end)- 21 payment = 5* before + 3* after elif start <= 21 and end >= 21: # if start before… 9pm and end before midnight payment = 3*(24 - end) elif start >= 21 and end <= 3: # if … 'if - elif' not working Programming Software Development by novice20 …if(map_dict1[int(MIO_outports1[i])] == int(Exp_map_inport[i]) ): flag = 1 elif(map_dict2[int(MIO_outports1[i])] == int(Exp_map_inport[i])): flag = 1 else… [/CODE] But I am not able to navigate to the 'elif' part. I am getting : [CODE] if(map_dict1[int(MIO_outports1[… Re: if, else, elif.. newb. Programming Software Development by Gribouillis …] optionally followed by zero or more blocks like [code=python] elif expression: statements [/code] and finally zero ore only one block… a given if statement, the keywords "if", "elif" and "else" must have the same indentation… Re: if, else, elif.. newb. Programming Software Development by Stefano Mtangoo …>=2: print 'Your total shipping charges: $2.10' elif shipweight>2 or shipweight<6: print 'Your total… shipping charges: $3.20' elif shipweight>6 or shipweight<10: print 'Your total… Re: 'if - elif' not working Programming Software Development by novice20 thanks raptr_dflo, but what I say is the key is present in 'map_dict2' so, why is the control not getting passed to the 'elif' part,?? when key is not present in 'map_dict1' it should check 'map_dict2' right?? Re: 'if - elif' not working Programming Software Development by novice20 …) if(map_dict1[int(MIO_outports1[i])] == int(Exp_map_inport[i]) ): flag = 1 elif(map_dict2.has_key(int(MIO_outports1[i]))): if(map_dict2[int(MIO_outports1[i… if -elif-else statement not working Programming Software Development by monica23 Good day everyone, I need to print data using if-elif statement. I when I run this code like this, everything … row['username'] == 'mutago': print " okay" sys.exit(0) elif row['password']=='muta55': print "good" else: print "… Re: if -elif-else statement not working Programming Software Development by woooee The OP has it correct [quote]I need to print data using if-elif statement elif row['password']=='muta55':[/quote]. Possible to have two strings on one elif? Programming Software Development by Frensi … if it's possible to have two strings on one elif. Something like this. name = input("What is your full…;Jack Neilson": print("I like your name") elif name == "John Cleese", "Michael Palin": print…