Please help solve this. Complete this function to either return "hello, (name)!" Or "Hello there!" | Sololearn: Learn to code for FREE!
0

Please help solve this. Complete this function to either return "hello, (name)!" Or "Hello there!"

def say_hello (""): print "hello";

10th Oct 2017, 8:54 PM
Sky
Sky - avatar
2 Antworten
0
answer below with a couple example calls. def say_hello(defaultname="there"): print("Hello " + defaultname + "!") inputname=input() say_hello() say_hello(inputname)
13th Oct 2017, 1:28 AM
Cory
- 1
def sayHello(*a): if a: print("Hello " + a[0]) else: print("Hello There!") sayHello("Justin") sayHello()
13th Oct 2017, 9:57 AM
LordHill
LordHill - avatar