Jul-16-2022, 09:18 AM
I tried the code, seems like this is what I was looking for.
That's great!
Thanks
Cheers
I asked the same question in stackoverflow, so I will share this link there
That's great!
Thanks
Cheers
I asked the same question in stackoverflow, so I will share this link there
(Jul-15-2022, 06:43 PM)BashBedlam Wrote: Okay, sorry. I think I understand now. Try this:
first_data=input('enter a country name: ') while True : print(first_data) last_letter=str(first_data[-1]).lower () print(last_letter) second_data=input('enter a country name starts with the last letter of previous country name: ') if second_data [0].lower () == last_letter : first_data = second_data else : break print ('You lose!')