Output from Sololearn and Python3 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Output from Sololearn and Python3

I often write code in some text editor and execute using python3 using terminal. When I use same code in sololearn, there is an irregular display of output. How I can overcome this?

7th Sep 2019, 7:01 PM
Siddhique
Siddhique - avatar
5 Answers
+ 3
Sure a=input( "Hey, Do you want to check whether a number is odd or even? Enter the number ") if not (a.isdigit()): print("No. The input is not an integer") elif int(a)%2==0: print("The number is even"? elif int(a)%2==1: print("The number is odd") If this code run in Sololearn, entire text comes at a time instead one after the other.
8th Sep 2019, 2:50 AM
Siddhique
Siddhique - avatar
+ 2
Can you explain more on irregular display of output. Maybe a example of code that creates this problem.
7th Sep 2019, 9:20 PM
Adam Kollgaard
Adam Kollgaard - avatar
+ 2
i think so it is about pop up version of input interface within sololearn. It has not same flexibility with python text editors. if we write any comment inside the input (like, ‘Hey,Do you....odd or even?) output returns instantly with this comment; so we can give info by #comment to avoid writing inside the (“”) input for sololearn interface. It is my solution :)
8th Sep 2019, 11:44 AM
Oğuz Kaan Mavice
Oğuz Kaan Mavice - avatar
+ 1
I think commenting would be a better alternative. Thank you Oguz and Adam.
8th Sep 2019, 5:54 PM
Siddhique
Siddhique - avatar
0
Because solo learn is a app. The creators came up with a weird way of getting inputs from languages like python. It seems that solo learn checks the code for a input and asks for a input prior to running the code. In my opinion I think the app shines with web development. You can clearly see this because most popular programs are in html, css, and js because it is the only way to show visual graphics and input, but I digress. There is no perfect way to get input through the app. The alternated way suggested is to write a long comment at the top detailed what to input. Then the user reads the comment and runs the program and knows what to type for an input. Ex. # Input a number to see if it is even or #odd. # created by: blah blah a=input( "Hey, Do you want to check whether a number is odd or even? Enter the number ") if not (a.isdigit()): print("No. The input is not an integer") elif int(a)%2==0: print("The number is even"? elif int(a)%2==1: print("The number is odd")
8th Sep 2019, 12:07 PM
Adam Kollgaard
Adam Kollgaard - avatar