0
Code not working
def main(me,friend) print("hey!") main("x","y") when I run this...I get output as hey! None.... what's the mistake?
6 ответов
+ 1
Put colon on the definition of main
def main(me,friend):
print("hey!")
0
@Moksh: you can't recognise a function that returns nothing?
@Sk: Basically, when a function doesn't have a return statement, it (implicitly) returns None. As your function doesn't have a return, it returns None.
0
@Moksh I expected output to be x & y....& @amaras I tried using return still getting no output.... can u alter the code to get the desired result?? I want output as X & Y
0
def main(me,friend):
print(main("x","y"))
return main
result is ...Indentation error for return
0
@moksh: why say print(str(me),str(friend))?
does it by default not mean that arguments inside the parentheses act as variable to values assigned to them within the function??
0
@Moksh...got it...thank u:)