def one():
print("1")
def two():
print("2")
def three():
print("3")
def four():
print("4")
def five():
print("5")
print(one(),two(),three(),four(),five(),end="")
Asked
Active
Viewed 37 times
-2
-
1The functions should return a value, not print it. – Barmar Jun 10 '21 at 15:45
-
Alternatively to @Barmar comment. You just can invoke these functions, not print them – Oscar Martinez Jun 10 '21 at 15:47
-
@OscarMartinez No, that won't print the results all on the same line. – Barmar Jun 10 '21 at 15:48
-
True, in that case he should add `end=""` to each print call inside each function – Oscar Martinez Jun 10 '21 at 15:50
2 Answers
-1
Would this work?
def one(): return("1")
def two(): return("2")
def three(): return("3")
def four(): return("4")
def five(): return("5")
print(one(),two(),three(),four(),five(),end="")

Pēteris Andrušaitis
- 23
- 3
-
1
-
1
-
Yes it's perfectly works did you explain how print and return work in this program – Balaji Jun 11 '21 at 03:08
-1
def one(): return "1"
def two(): return "2"
def three(): return "3"
def four(): return "4"
def five(): return "5"
print(one(),two(),three(),four(),five(),end="")

toships
- 1
- 1
-
1
-
Yes it's perfectly works did you explain how print and return work in this program – Balaji Jun 11 '21 at 03:08