Question: City is a named tuple with fields: name, state, and population. Read two strings and one integer from input. Create city_data as a City tuple,
City is a named tuple with fields: name, state, and population. Read two strings and one integer from input. Create city_data as a City tuple, and initialize city_data with city_name, state_located, and population_count as the fields. from collections import namedtuple City = namedtuple('City', ['name', 'state', 'population']) ''' Your code goes here ''' print(f'City name: {city_data.name}, State: {city_data.state}, Population: {city_data.population}')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
