given_word = input() first_word = "" for char in given_word: if char == " ": break else: first_word += char print(first_word)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter