0
Can somebody help me?
I don't know why the input "Enter number" and the result are displayed on the same line Here is the code: x = int(input("Enter number:")) if x == 7: print('Correct!') else: if x < 7: print('Less then 7!') if x > 7: print('Greater then 7!')
1 Odpowiedź
+ 7
x = int(input("Enter number: "))
print (x, end="")
if x == 7:
print("\nCorrect!")
else:
if x < 7:
print("\nLess then 7!")
if x > 7:
print("\nGreater then 7!")
The \n inserts a line break character into a string, @Mind To Machine was right..