Help please i can't run more than 1 code in Python shell 2.7.12 it produces output for only the first line and ignores all other input... Pls some1 help me. | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Help please i can't run more than 1 code in Python shell 2.7.12 it produces output for only the first line and ignores all other input... Pls some1 help me.

s= input ("Enter a name: josh") t= input ("Enter a number: 1") Print (s) Print (t) Output Enter a name: josh

28th Nov 2016, 3:58 PM
Modupe
3 Antworten
+ 1
you have to decide what version you use, also. you have something like mixup. you say you use 2.7, but functions are 3.x-style, maybe there's a conflict? 2.7: raw_input() 3.x: input() 2.7: print x 3.x: print(x)
28th Nov 2016, 8:37 PM
Demeth
Demeth - avatar
0
input function writes a string you passed to it and then waits for you to type something it will then assign to a variable. if you don't give your input, it will stuck on this place until you do. also, print function is written without capital letters.
28th Nov 2016, 5:51 PM
Demeth
Demeth - avatar
0
Yeah thanks , abt the print that was me. But i did give the input and pressed enter, yet nothing happened
28th Nov 2016, 8:31 PM
Modupe