+ 1
How can I create the If, Answer, Then Functions?
My terminology could be incorrect as I'm a first time coder, but if there are some out there that can provide me with a coherent answer I will really appreciate it..
2 odpowiedzi
+ 8
Hi handsomejames
I take it you're facing some challenges with below code throwing indentation error
https://sololearn.com/compiler-playground/cb8XcNND1xEH/?ref=app
In python indentation(white space) is important as it tells python which line of code belong together in a specific block .For eg
Statement
If condition:
Statement
else :
Statement
Moreover input() returns a string so it needed to be converted to integer for comparison
Below is the updated code
https://sololearn.com/compiler-playground/cWjakxqkmKZr/?ref=app
Also it's suggested to go through any python tutorial for learning to create function and to refine your understanding on above features ,there's one 'Introduction to Python' course available here from course section that you could give it a shot
Please let us know for any further queries .
+ 4
handsomejames ,
since your profile shows that you have joined sololearn just 10 hours ago, i would rather recommend you to start learning from the python tutorials than asking `unspecific` questions here.
if you are interested in python, you may start with `introduction to python`. also practice as much as you can afford. keep in mind that learning coding can not be done by rushing over it. it takes some time to get learning the basics.