Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
You are return a value so it requires a variable to store it so instead of foo(1) use this: i=foo(1) Then it will be correct. Happy coding
4th Jun 2020, 3:07 PM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 1
it is not an code error, it is a logical error, the value of i will never change because the varable "i" outside the functcion isn't the same variable "i" inside the function
5th Jun 2020, 4:32 PM
angel antolin
angel antolin - avatar
- 1
ok, it's giving an IndentationError bcz there are 3 space indentations not 4. Use 4 spaces or 1 tab before i=i+1 and return i
4th Jun 2020, 3:08 PM
M Tamim
M Tamim - avatar