Why it doesn't work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why it doesn't work?

x = 9 y = int(input("число")) print(y) z = (x*y) if z >= x: print ("ok1") else: print ("bed")

13th Mar 2018, 7:36 AM
Василь Биба
Василь Биба - avatar
8 Answers
+ 9
#It should work with this x = 9 y = int(input("число")) #P.s This is correct print(y) z = (x*y) if z >= x: print ("ok1") #give a space else: print ("bed")
13th Mar 2018, 7:51 AM
David Akhihiero
David Akhihiero - avatar
+ 10
Because "число" is not an Integer EDIT : This is not correct. "число" is a value that prints before input is taken
13th Mar 2018, 7:42 AM
David Akhihiero
David Akhihiero - avatar
+ 7
Indentation error, give an indent before "print("ok1")
13th Mar 2018, 7:48 AM
David Akhihiero
David Akhihiero - avatar
+ 6
@Yeruchan The argument inside the input() function is the text that is displayed to the user when they need to input something.
13th Mar 2018, 7:54 AM
Gami
Gami - avatar
+ 5
The statements inside if else blocks should be indented. That means it needs to have a number of 2 or 4 spaces. x = 9 y = int(input("число")) print(y) z = (x*y) if z >= x: print ("ok1") else: print ("bed")
13th Mar 2018, 7:52 AM
Gami
Gami - avatar
+ 1
without "число" the same problem. error in line 6
13th Mar 2018, 7:47 AM
Василь Биба
Василь Биба - avatar
+ 1
how it should be in right way?
13th Mar 2018, 7:47 AM
Василь Биба
Василь Биба - avatar
+ 1
how it should be in right way?
13th Mar 2018, 7:50 AM
Василь Биба
Василь Биба - avatar