0
There is error coming in my code I've tried 4 times...but it's still telling invalid syntax
3 Respostas
+ 5
1. Mind code indentation, code indentation is very important in Python.
2. Function name may not contain spaces, look at your function name and replace spaces by underscores.
3. You forgot to put assignment operator in your <result> variable definition.
+ 2
def divisible_by_3_and_5(num):
result=[]
for i in range(num):
if i%3==0 and i%5==0:
result.append(i)
return result
num=int(input("my number\n"))
result=divisible_by_3_and_5(num)
print(result)
0
Ok