0

Code not Working On this app

I had Written a code in Python IDLE and it is working perfectly in IDLE But when I wroted that code in this app It shows Error the code is like : print " Please enter your age Below:" age = 18 x = input ('Enter your age:') if x > age : print "you can vote" if x < age : print "you can't Vote"

14th Feb 2017, 7:58 AM
Knowledge Seeker
Knowledge Seeker - avatar
5 Answers
+ 4
() for the print function print("...") and respect indentation
14th Feb 2017, 8:03 AM
Kawaii
Kawaii - avatar
+ 3
this will work...keep in mind this points. 1. print("") 2. indentation 3. the input is string you need to change it to integer before you compare it with age print(" Please enter your age Below:") age = 18 x = int(input('Enter your age:')) if x >= age : print("you can vote") if x < age : print("you can't Vote")
14th Feb 2017, 8:05 AM
Pankaj Vaghela
Pankaj Vaghela - avatar
+ 3
There are different versions of python We have python 2. We also have python 3. Your code will work well in version 2 but not python 3 and this app use python 3 please download python 3.7 which is the latest version as there is little support for python 2 Me myself I would recommend you just download Anaconda letest version for python 3 and JetBrains Pycharm for an editor Anaconda contains most useful python packages like matplotlib, numpy & scipy for doing graphs, mathematical & scientific data analysis Pycharm is the best python IDE Please move away from python 2 if you're a freshman in Python #don't forget to use the correct syntax & indent your code """ please forgive my English if it's bad """ # For the love of coding the love of python.
17th Feb 2017, 11:29 AM
Yongz
Yongz - avatar
+ 2
maybe your IDLE is smarter than this App. xD it will have inbuilt methods to ignore those errors and do it itself
14th Feb 2017, 8:14 AM
Pankaj Vaghela
Pankaj Vaghela - avatar
0
Why My IDLE working fine with this code but this app showing error????
14th Feb 2017, 8:12 AM
Knowledge Seeker
Knowledge Seeker - avatar