0

Python Functions

str1=input(‘name: ‘) Def func(a): For i in a: Print(i,end=‘ ‘) Print(func(str1)) Answer is: a b c None How can I change the code so I don’t get ‘None’ in answers?

4th May 2021, 3:35 PM
Mah~
Mah~ - avatar
2 Answers
0
Remove print() from print(func(str1)). Reason: Your function was returning None.
4th May 2021, 4:25 PM
Rahul Saxena
Rahul Saxena - avatar
0
Thanks!
4th May 2021, 3:50 PM
Mah~
Mah~ - avatar