Question: Consider the code given below, write down the correct version by identifying and removing/correcting all the errors . (5 Marks) Code must print the birth

  1. Consider the code given below, write down the correct version by identifying and removing/correcting all the errors. (5 Marks)

Code must print the birth of year of each person in the format as given below:

(Asif was born in 1977)

names = ['Asif', 'Kamran', 'Ali', 'Kashif', 'Nouman']

ages = [45, 32, 18, 38, 31]

current_year = 2021

for person in range(6)

age = ages(person)

name = names[person]

year_of_birth = current_year - age + 1

print('name' + ' was born in ' + year_of_birth

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!