0

Error with code

Hey I was working on this code I'm an beginner so I was messing around a little with this code I made but it's not working: def square(x): return x * x numbers = [1, 2, 3, 4, 5] for n in numbers print(square(n)) Can someone help me get it running?

6th Sep 2025, 4:01 AM
Andreas Nick
3 odpowiedzi
+ 1
# Hi! print("1. The word 'def' should be to the left of the return", end="\n\n") print("2. and you forgot the colon ':' in the second-to-last line of the code.")
6th Sep 2025, 5:18 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
If you can add the code like this guide, it can help others to help you more easily in the future. https://sololearn.com/compiler-playground/Wek0V1MyIR2r/?ref=app
6th Sep 2025, 6:51 AM
Ausgrindtube
Ausgrindtube - avatar
0
Thx
6th Sep 2025, 11:43 AM
Andreas Nick