0

how I can work with python?

when I open python in my computer and write this >>>x=1 >>>while x<5 : ...print(I) then press inter I see this file "<stdin>", line 2 print(I) please help me

22nd Jul 2016, 6:50 PM
Bardya Abbasi
Bardya Abbasi - avatar
6 Answers
+ 1
you didnt even define what "I" is
22nd Jul 2016, 6:58 PM
uygar bĂŒyĂŒkkahraman
uygar bĂŒyĂŒkkahraman - avatar
+ 1
bardya, you cant use a variable without passing a value to it but you can use i in for loops to pass the amount of numbers in an array(etc.) but you didnt use i for anything like that. replace print(I) with print(x) and add line x-=x to make it stop.
22nd Jul 2016, 8:11 PM
uygar bĂŒyĂŒkkahraman
uygar bĂŒyĂŒkkahraman - avatar
+ 1
i=1 while i<5: i=i+1 print(i) 2 3 4
23rd Jul 2016, 9:19 AM
André Augusto Nunes Vieira
André Augusto Nunes Vieira - avatar
0
sorry my mean (i)
22nd Jul 2016, 7:11 PM
Bardya Abbasi
Bardya Abbasi - avatar
0
You didn't define i
22nd Jul 2016, 8:08 PM
cory schattenfield
0
yes, now I can't use multi line such as for , while ,... . when I type this: >>>i=1 >>>while i<5 : ...print(i) when press enter to write i=i+1 the program running and shaw error
23rd Jul 2016, 6:27 AM
Bardya Abbasi
Bardya Abbasi - avatar