+ 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")
15 Respuestas
+ 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)
+ 2
Thats actually right. Multiple input just doesnt work in sololearn
+ 2
Tejas Joshi and Slick we can take multiple input with separate line like:
AJ
ANANT
30
+ 2
Only in sololearn my man.
+ 2
Slick we can print like this
num1 = int(input("Enter a number:"))
print(num1)
num2 = int(input("Enter another number:"))
print(num2)
+ 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.
+ 1
so does it only happens in solo learn or in python application also??
+ 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
+ 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.
+ 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")
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??..
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
- 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.
- 1
print("abc", end="\n")
- 1
Hey..!
How I learn coding....?