greeting0.
py
1 def greet(input):
2 if "hello" in input:
3 print("hello, there")
4 else:
5 print("I'm not sure what you mean")
6
7
8 greet("hello, computer")
[Link]
1 def greet(input):
2 if "hello" in input:
3 return "hello, there"
4 else:
5 return "I'm not sure what you mean"
6
7
8 greet("hello, computer")
[Link]
1 def greet(input):
2 if "hello" in input:
3 return "hello, there"
4 else:
5 return "I'm not sure what you mean"
6
7
8 greeting = greet("hello, computer")
9 print(greeting)
[Link]
1 def greet(input):
2 if "hello" in input:
3 return "hello, there"
4 else:
5 return "I'm not sure what you mean"
6
7
8 print(greet("hello, computer"))
[Link]
1 def greet(input):
2 if "hello" in input:
3 return "hello, there"
4 return "I'm not sure what you mean"
5
6
7 print(greet("hello, computer"))
[Link]
1 def greet(input):
2 if "hello" in input:
3 return "hello, there"
4 return "I'm not sure what you mean"
5
6
7 print("Hm, " + greet("hello, computer"))
[Link]
1 def greet(input):
2 if "hello" in input:
3 return "hello, there"
4 return "I'm not sure what you mean"
5
6
7 greeting = greet("hello, computer")
8 print(greeting + " Carter")
9 print(greeting + " David")
10 print(greeting + " Rongxin")