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
- 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
Get step-by-step solutions from verified subject matter experts
