Computer Science Project: Done by Veera Bhavani XIA
Computer Science Project: Done by Veera Bhavani XIA
PROJECT
DONE BY
VEERA BHAVANI
XI A
Difference of Lists, Tuples and Dictionary
S.NO LISTS TUPLES DICTIONARY
Output:
[(‘s’,3),(‘g’,8)]
{‘s’:3,’g’:8}
Convert dictionary to list
■ Convert dictionary to list:
Dict=input(“Enter dictionary”)
Print(dict)
L=dict.items()
Print(l)
■ E.g., dict={‘a’:2,’b’:4,’c’:5}
Print(dict)
L=dict.items()
Print(l)
Output:
>>>
{‘a’:2,’b’:4,’c’:5}
[(‘a’,2),(‘b’,4),(‘c’,5)]
>>>