+ 1

Problem with lists in python

I tried to make list like this: nums=[5,4,3,2,1] print(nums[0]) print(nums[1]) print(nums[3]) But, after first line with print, when i clicked Enter, my 'code' ends there and I cant write other two columns with print? How should I do that? Im begginer, sory for silly question and for my bad english, it isnt my primary language.

11th Jan 2017, 8:31 AM
Nikola Štulović
3 ответов
+ 1
Use Python IDLE so that u can exuecute multiple lines of code..
11th Jan 2017, 8:42 AM
Gopikrishna A
Gopikrishna A - avatar
0
Yeah, Im using it. I 'solved ' my problem writing: if num==num: print.. Can i always do it like that or..?
11th Jan 2017, 8:45 AM
Nikola Štulović
0
its very weird. what device do you have Python on? are you using your phone or a computer? I just tried your code and it works fine. you can also try : print(nums[0]," ",nums[1]," ",nums[3])
11th Jan 2017, 2:20 PM
ramzi
ramzi - avatar