Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

How to combine the output of multiple lists in python

countries = ['USA', 'Canada', 'UK', 'Australia']
cities = ['Washington', 'Ottawa', 'London', 'Canberra']

for x, y in zip(countries, cities):
  print('The capital of {} is {}.'.format(x, y))


# Output

# The capital of USA is Washington.
# The capital of Canada is Ottawa.
# The capital of UK is London.
# The capital of Australia is Canberra.
Comment

PREVIOUS NEXT
Code Example
Python :: paginate @registrations 
Python :: design patterns in python free download 
Python :: python error bars 
Python :: Python | Program to print duplicates from a list of integers 
Python :: pandas merge keep one of column copy 
Python :: Send Variable Over In Python Views 
Python :: install robobrowser python 3 
Python :: pytrend 
Python :: split string and remove some and re-create again 
Python :: first flask api 
Python :: django template many to many count 
Python :: data structures in python 
Python :: how to assign key and value to hash dictionary in python 
Python :: python long multiline text 
Python :: Random parola uretme 
Python :: convert python code to dart online 
Python :: how a 16 mp camera looks like 
Python :: difference between = and is not python 
Python :: how to install pandas in python by git 
Python :: how to create a cubic function in python 3 
Python :: list to string without loop 
Python :: fredo illos 
Python :: numpy symmetrize array 
Python :: online python text editor 
Python :: Python of if...else 
Python :: install plotly manually 
Python :: python decode errors schemes 
Python :: Python send sms curl 
Python :: Qt spinning box 
Python :: BMI CALCULATOR CODE IN PYTHON 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =