Answer to Question #199035 in Python for kolsuz

Question #199035

Write a function greeting that consumes a string of length at least three and produces "Hello"

if the first three characters are "Hi!" and produces "Bye" otherwise.




1
Expert's answer
2021-05-27T23:27:45-0400
def greeting(msg):
    if msg=="Hi!":
        print("Hello")
    else:
        print("Bye")


        
greeting(input("Enter message: "))




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS