Sorry, im new in python (or programming in general) & just starting to study for loop. The thing is, i want to combine 2 string lists and register it into for loop to kind of print it in seperate ways, its confusing, but heres the code :
list1 = ['george','james','manon','danielle','chris']
list2 = ['2000','2001','1998','1999','2002']
comblist = list1+list2
for x in comblist:
print("Hi my name is",x[:5],"and i was born in the year",x[5:10])
I was expecting the output to be like this :
Hi my name is george and i was born in the year 2000
Hi my name is james and i was born in the year 2001
Hi my name is manon and i was born in the year 1998
Hi my name is danielle and i was born in the year 1999
Hi my name is chris and i was born in the year 2002
But instead it turned out like this :
Hi my name is georg and i was born in the year e
Hi my name is james and i was born in the year
Hi my name is manon and i was born in the year
Hi my name is danie and i was born in the year lle
Hi my name is chris and i was born in the year
Hi my name is 2000 and i was born in the year
Hi my name is 2001 and i was born in the year
Hi my name is 1998 and i was born in the year
Hi my name is 1999 and i was born in the year
Hi my name is 2002 and i was born in the year
What did i do wrong? All help is appreciated. Thanks!