Function don’t work ! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Function don’t work !

Hello! I have a problem, when I do not make a function from the code, everything works, but I’m doing it, it gives an error. How can I fix this? https://code.sololearn.com/cYrkKae5e6db/?ref=app

19th Jun 2019, 1:26 PM
Наталья Морская Пехота
Наталья Морская Пехота - avatar
2 Answers
+ 1
This is a fixed version. Pay attention to the indentation of the lines following 'def' and also following 'if'. By convention, each new indent should be 4 whitespaces. https://code.sololearn.com/cRb10GFpVQia/?ref=app
19th Jun 2019, 1:50 PM
Tibor Santa
Tibor Santa - avatar
+ 1
You must indent after defining a function (tab button or 4 spaces from keyboard)
19th Jun 2019, 1:30 PM
Mo Hani
Mo Hani - avatar