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.




Expert's answer

def greeting(msg):
    if msg=="Hi!":
        print("Hello")
    else:
        print("Bye")


        
greeting(input("Enter message: "))




LATEST TUTORIALS
APPROVED BY CLIENTS