Print a function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Print a function

n = int(input()) def print(n): for n in range(1, n+1): print(n, end=" ") this is my code! It should take an integer for example 3 and it should output 123. WARNING: Please don't directly give me an answer Just tell me what is wrong in my code! Thank you stay safe!

4th Feb 2021, 4:43 PM
Ailana
Ailana - avatar
2 Answers
+ 2
Ailana print is inbuilt and reserved function so you should not make method with same name.
4th Feb 2021, 4:48 PM
A͢J
A͢J - avatar
+ 1
Ok thanks! Have a nice day!
4th Feb 2021, 5:07 PM
Ailana
Ailana - avatar