Pyhton as a new beginning

phone_numbers={"John Smith":"+37682","Marry Simpsons":"+42399"}
for pair in phone_numbers.items():
    print("{} has a phone number and it is {}".format(pair[0],pair[1]))

Same output but the code is in diffrent approach.

    
phone_numbers={"John Smith":"+37682","Marry Simpsons":"+42399"}
for key,value in phone_numbers.items():
    print("{} has a phone number and it is {}".format(key, value))

 

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *