Correct mezz | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
17th Aug 2019, 6:38 AM
Akash Pawar
Akash Pawar - avatar
4 Answers
+ 7
Akash - there is nothing to correct in this code. Sorry to say - there are more errors than lines in code. From my point of view you should go deeper in basics of python.
17th Aug 2019, 6:48 AM
Lothar
Lothar - avatar
+ 6
Hi Akash Pawar, it's a good first try! I believe this is what you want: a = input("yes or no") if a == "yes": print("thanks") else: print("its ok") I agree with Lothar that you need to go back to basics, particularly the syntax for input() and print() functions and for if: / else: statements. You may be going through the lessons too fast. I would start over at the beginning of the lessons and work your way through them slowly. (I did.) Take your time. Practice writing your own codes for every new concept. If anything doesn't make sense, see if you can find help in the lesson comments. Use Google a lot. It helps to see each new concept from several different viewpoints, so I suggest looking them up in a few tutorials, for example, https://www.programiz.com/JUMP_LINK__&&__python__&&__JUMP_LINK-programming https://www.learnpython.org https://www.tutorialspoint.com/python https://docs.python.org/3.7/tutorial It's a slower process but it's worth it because the knowledge you get will stick. Keep up the good work! 😊
17th Aug 2019, 7:12 AM
David Ashton
David Ashton - avatar
+ 3
Thanks to all
17th Aug 2019, 9:20 AM
Akash Pawar
Akash Pawar - avatar
0
a = str(input()) if a == "yes": print("thanks") else : print("its ok") Try Using string in input operator in offline editor and revise if and else condition in tutorials🤘🏻
17th Aug 2019, 8:30 AM
Sarvesh Yadav
Sarvesh Yadav - avatar