0

User = ("Peter", James, "John)

Age = (18 , 20 , 22)

str = "{}, is a laborious student and he is {}."

Output :

  1. Peter, is a laborious student and he is 18.
  2. James, is a laborious student and he is 20.
  3. John, is a laborious student and he is 22.
  • Welcome to SO! In order to post a question you should bring a minimum information as a input sample and expected output sample (if needed), what did you try and your research, in order to show some effort, as SO is not a free coding service. What did you try and research? – David García Bodego Dec 01 '19 at 03:47

1 Answers1

0

Use zip to iterate two tuples in parallel.

users = ("Peter", "James", "John")

ages = (18 , 20 , 22)

for (a, b) in zip(users, ages):
    str = "{}, is a laborious student and he is {}.".format(a, b)
    print(str)

More information

alfredo138923
  • 1,509
  • 1
  • 15
  • 15