Novice · Input and output · 13 of 264
Initials
Read a first and a last name and print the initials, each followed by a dot.
Input: the first name on the first line, the last name on the second. Output: the initials, e.g. A.L. Tip: name[0] is the first letter of name.
Examples
Input
Ada Lovelace
Output
A.L.
Input
Alan Turing
Output
A.T.
One more test checks other inputs when you press Check.
Stuck? The idea behind input and output
input() waits for one line typed by the user and gives it back as text. Keep it in a variable to use it later.
Each call reads one line, so a program that needs two answers calls input() twice.
name = input()
town = input()
print(f"{name} lives in {town}.")Watch for: Don't put a question inside input("...") here: the prompt is printed too, and the tests compare everything printed.