Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

list names_list is created with two names read from input. then, list c…

Question

list names_list is created with two names read from input. then, list countries_list is created with two countries read from input. on one line, output: - names_lists first element - \lives in\ - countries_lists second element - a period (\.\) click here to show example 1 # reads two values from input into names_list 2 names_list = input(), input() 3 # reads two values from input into countries_list 4 countries_list = input(), input() 5 6 \\\ your code goes here \\\ 7 8

Explanation:

Step1: Access required list elements

First element of names_list: names_list[0]; second element of countries_list: countries_list[1]

Step2: Combine elements into string

Concatenate the elements with required text and period.
<Expression>
print(f"{names_list[0]} lives in {countries_list[1]}.")
</Expression>

Answer:

# Reads two values from input into names_list
names_list = [input(), input()]
# Reads two values from input into countries_list
countries_list = [input(), input()]

print(f"{names_list[0]} lives in {countries_list[1]}.")