From 2e569cae62d22260936ab1a3971afabff420d525 Mon Sep 17 00:00:00 2001 From: Kiran Rai Date: Mon, 1 Aug 2022 17:37:24 +0100 Subject: [PATCH] Why am I not giving my best to learn python? --- main6(revision).py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/main6(revision).py b/main6(revision).py index 3962fe5..cdffcd5 100644 --- a/main6(revision).py +++ b/main6(revision).py @@ -66,7 +66,7 @@ # list1 = [[1,2,3],[4,5,6],[7,8,9]] # for sublist in list1: # for i in sublist: -# print(i) +# print(i) # print(type(list1)) # list2 = [ @@ -74,8 +74,21 @@ # ] # list2.insert([1],[1],4) # print(list2) - +""" list3 = [1,2,3,4,5,7,8] list3.clear() -print(list3) +print(""" + +# Dictionary +# A dictionary is a collection which is unordered, changeble and indexed. In python dictionaries are written within curly brackets, and they have keys and values. Means the dictionary contains two things first is the key and second is value. +""" +dict1 = {'Kiran': "Rai", 'Dipika': "Tamang",} +for x in dict1.values(): + print(x) +""" +# change value of dictionary + +dict1 = {'Kiran': "Rai", 'Dipika': "Tamang",} +dict1['Dipika'] = 'Rai' +print(dict1)