Simple input and output problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Simple input and output problem

take a look with this script oke = input("testing: ") if oke == ferrari: print "ferrari car" else: print "not ferrari car" if im type ferrari its ouptut will "ferrari car".but why when im type something else the output is not "not ferrari car" but its going to error? im also try if oke not == ferrari.the same error output

8th Apr 2017, 5:36 AM
Kevin AS
Kevin AS - avatar
5 Answers
+ 3
change oke == ferrari to-> oke == "ferrari"
8th Apr 2017, 6:32 AM
Constantin E.
Constantin E. - avatar
+ 1
still error.i try it at linux with python
8th Apr 2017, 12:30 PM
Kevin AS
Kevin AS - avatar
+ 1
Which version of Python use you? before Version 3: use -> print "ferrari car" Test: >>> testing: "ferrari" >>> ferrari car Version 3: use -> print( "ferrari car") Test: >>> testing: ferrari >>> ferrari car
8th Apr 2017, 1:36 PM
Constantin E.
Constantin E. - avatar
0
wow so its diffrent.thanx a lot.u r genius.keep helping constantin!
8th Apr 2017, 3:44 PM
Kevin AS
Kevin AS - avatar
0
I need XP please
7th May 2020, 1:10 PM
Venkat S
Venkat S - avatar