+ 4

Hey need help!!

Hey can anyone tell me how to print input statement in sperate line so that 2 input statement wouldn't continue after 1 another try: num1 = int(input("Enter a number:")) num2 = int(input("Enter another number:")) if num1 / num2 == 6: print("awesome") else: print("not awesome") except ZeroDivisionError: print("An error occured\n due to zero division")

13th May 2020, 10:32 AM
Tejas Joshi
Tejas Joshi - avatar
15 Antworten
+ 9
Nothing's wrong with your code but not preferable for Sololearn Just take the input like 12 13 (take the two nums in two different lines)
13th May 2020, 2:04 PM
Mehnaz ✨
Mehnaz ✨ - avatar
+ 2
Thats actually right. Multiple input just doesnt work in sololearn
13th May 2020, 10:33 AM
Slick
Slick - avatar
+ 2
Tejas Joshi and Slick we can take multiple input with separate line like: AJ ANANT 30
13th May 2020, 10:43 AM
A͢J
A͢J - avatar
+ 2
Only in sololearn my man.
13th May 2020, 10:46 AM
Slick
Slick - avatar
+ 2
Slick we can print like this num1 = int(input("Enter a number:")) print(num1) num2 = int(input("Enter another number:")) print(num2)
13th May 2020, 10:49 AM
A͢J
A͢J - avatar
+ 2
Slick You are also right. Sololearn terminal is different than other IDE. In other IDEs we take input through console but here with prompt in separate line. Tejas Joshi Only on Sololearn we take input in separate line.
13th May 2020, 11:06 AM
A͢J
A͢J - avatar
+ 1
so does it only happens in solo learn or in python application also??
13th May 2020, 10:44 AM
Tejas Joshi
Tejas Joshi - avatar
+ 1
AJ #Infinity Love true, but i think poster wants it to print the actual statement in the output like in an IDE or terminal in real time
13th May 2020, 10:45 AM
Slick
Slick - avatar
+ 1
AJ #Infinity Love right, but here in sololearn, we'd still need to put all of our input in at the same time. In an IDE or terminal we type input as the input prompts come up. One at a time.
13th May 2020, 10:51 AM
Slick
Slick - avatar
+ 1
It is your code but with a few changes. try: num1 = int(input("Enter a number:")) print(num1) num2 = int(input("Enter another number:")) print(num2) if num1 / num2 == 6: print("awesome") else: print("not awesome") except ZeroDivisionError: print("An error occured\n due to zero division")
15th May 2020, 4:52 PM
Shivesh Gupta
0
AJ #Infinity Love Okay so I can write in separate line in solo learn with your code but does I have to type like this on python application also?? or my orginal code will execute like on separate like as of Slick said??..
13th May 2020, 10:53 AM
Tejas Joshi
Tejas Joshi - avatar
0
num1 = int(input("Enter a number:")) num2 = int(input("Enter another number:")) if num1 / num2 == 6: print("awesome") else: print("not awesome") Thats actually right. Multiple input just doesnt work in sololearn
15th May 2020, 4:14 PM
Kartik Kaushal
Kartik Kaushal - avatar
- 1
Please solve this Write a program to input marks of three tests of a student (all integers). Then calculate and print the average of all test marks.
14th May 2020, 7:07 PM
Satyam Patel
Satyam Patel - avatar
- 1
print("abc", end="\n")
15th May 2020, 8:54 AM
Abhishek Thakur
Abhishek Thakur - avatar
- 1
Hey..! How I learn coding....?
15th May 2020, 10:16 AM
Anonymous