what should i use to get in to next line ? words=["Hello","world","!"] print(words[0]) {then i pushed enter to write next line,but gave me answer , i mean i couldn't follow order that has been given} Hello and how should i write print(words[1]) in next lint without interruption? 😕 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what should i use to get in to next line ? words=["Hello","world","!"] print(words[0]) {then i pushed enter to write next line,but gave me answer , i mean i couldn't follow order that has been given} Hello and how should i write print(words[1]) in next lint without interruption? 😕

12th Jul 2016, 11:35 AM
Reza Zarakani400000
Reza Zarakani400000 - avatar
4 Answers
+ 1
Use three print() functions and call every value in the list. Also, you can use this function to put a blank line on the screen; just call print() with nothing in between the parentheses.
12th Jul 2016, 11:43 AM
Francisco Gómez García
Francisco Gómez García - avatar
+ 1
so the main structure doesn't work properly😕
12th Jul 2016, 12:35 PM
Reza Zarakani400000
Reza Zarakani400000 - avatar
+ 1
There's nothing wrong with your program structure. Its depends of how you want to test the program. The interactive shell is good to run Python instructions one at a time (as soon as you press ENTER). To type an entire program you have to use the file editor.
12th Jul 2016, 12:46 PM
Francisco Gómez García
Francisco Gómez García - avatar
0
u r writing code in python command line so the print function was executed just right after u press enter.. try to write code in Python IDLE.. it will execute the whole code
13th Jul 2016, 11:11 AM
Subhankar Paul
Subhankar Paul - avatar