def Complicated_Greetings(name): hello_part = ["H", "e", "l", "l", "o"] world_part = ["W", "o", "r", "l", "d"] space = chr(32) comma = chr(44) exclamation = chr(33) two_exclamations = exclamation + exclamation greeting = "" for letter in hello_part: greeting += letter # Funny check if len(name) == 0: greeting += comma greeting += space for letter in world_part: greeting += letter greeting += two_exclamations else: greeting += space for char in name: greeting += char return greeting #MrQexoWasHere:))
- def Complicated_Greetings(name):
h=["H","e","l","l","o"]c=","w=["W","o","r","l","d"]e="!"k=""for i in h:k+=iif name=="":k+=ck+=" "for i in w:k+=ik=k+e+e- hello_part = ["H", "e", "l", "l", "o"]
- world_part = ["W", "o", "r", "l", "d"]
- space = chr(32)
- comma = chr(44)
- exclamation = chr(33)
- two_exclamations = exclamation + exclamation
- greeting = ""
- for letter in hello_part:
- greeting += letter
- # Funny check
- if len(name) == 0:
- greeting += comma
- greeting += space
- for letter in world_part:
- greeting += letter
- greeting += two_exclamations
- else:
k+=" "k+=namereturn k- greeting += space
- for char in name:
- greeting += char
- return greeting
- #MrQexoWasHere:))