Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Execute two line Python script in Intellij Idea Python Console

In Intellij Idea, there is Python Console and it works fine with one-line commands.

I tried to enter a two liner by pressing Shift + Enter at the end of the first line which is a common shortcut in chats, for example, and added a second line. Now, the console looks like this and I don’t know how to execute the statements I entered:

>>>  for item in l:
...      print(item)

When I press Enter or Shift + Enter it just adds another line:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>>>  for item in l:
...      print(item)
...

>Solution :

Press Enter again please
Imagine if you press Enter once to execute, how to add other statements

>>> a = [1, 2, 3, 4, 5]
>>> for i in a:
...     print(i)
... 
1
2
3
4
5
>>> 

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading