Y.G. Bae (36) [Avatar] Offline
#1
I am just wondering whether it would be more efficient just to call the "name" variable again in the last line because the existing for loop already catches the last name in the iteration after the last space:

names = input("Tell me some names, separated by spaces: ")
name = ""
for ch in names:
    if ch == " ":
        print("Hi", name)
        name = ""
    else:
        name += ch
# deal with the last name given (does not have a space after it)
print("Hi", name)
Ana Bell (29) [Avatar] Offline
#2
You're right, that would be simpler and more "pythonic"!