Day 10 --------- Dictionary QUESTIONS(Theory) ------------------ 1.What is a dictionary in Python? 2.How do you get all values from a Python dictionary? 3.What are the methods available in Python dictionary? 4.How do you remove particular pair from a Python dictionary? 5.What is a purpose of popitem() method? 6.What is difference between pop() and popitem()? 7.How do you add the value in the dictionary? 8.What are possible ways to get value of corresponding key? 9.What is possible ways to update more than one key,value pair in dictionary? 10.What is method used for print all keys ? 11.What is method used for print all values ? 12.What is returntype of Keys() and values()? 13.What is method used for removing all value in dictionary? 14.Is it possible to copy dictionary QUESTIONS(Practical) --------------------- QUESTION 1: ------------ QUESTION 1.1: ------------------- Description : Create a Dictionary with the below key , values and find the length of it key : 100,200,300,400,500,600,100,500,400 values : java,sql,oops,Sql,oracle,DB,selenium,psql,Hadoop. QUESTION 1.2: ------------------- Description : Create a Dictionary with the below key , values and find the length of it key : 'a','b','c','d','e' Values : 10,20,30,40,50 QUESTION 1.3: ------------------ Description : Create a Dictionary with the below key ,values and find the length of it key : 90,60,40,20,55,70,30,100 Values : 11.50 , 20.50 , 55.00, 88.90 ,33.30 , 66.00,99.99 QUESTION 1.4: ------------------ Description : Create a Dictionary with the below key ,values and find the length of it Key : 'vel','Ganesh','Dinesh','Vengat','subash' Values : 'Selenium','framework','oracle','python','jira' QUESTION 2: -------------- QUESTION 2.1: -------------------- Description : Create a Dictionary with the below key and values and get(print) the values only in the Dictionary . key : 'a','b','c','d','e' Values : 10,20,30,40,50 QUESTION 2.2: -------------------- Description : Create a Dictionary with the below key and values and get(print) the values only in the Dictionary . Key : 'vel','Ganesh','Dinesh','Vengat','subash' Values : 'Selenium','framework','oracle','python','jira' QUESTION 2.3: -------------------- Description : Create a Dictionary with the below key and values and get(print) the values only in the Dictionary . Key : 10,20,30,40,50,60,10,50,40 Values : 10+10j,20+2j,30+3j,40+4j,50+5j,60+6j,10+10j,50+5j,40+4j QUESTION 3: ------------------ QUESTION 3.1: -------------------- Description : Create a Dictionary with the below key and values and get(print) the keys only in the Dictionary . Key : 10,20,30,40,50,60,10,50,40 Values : 101,202,303,404,505,606,101,505,404 QUESTION 3.2: -------------------- Description : Create a Dictionary with the below key and values and get(print) the keys only in the Dictionary . Key : 'vel','Ganesh','Dinesh','Vengat','subash' Values : 'Selenium','framework','oracle','python','jira' QUESTION 3.3: -------------------- Description : Create a Dictionary with the below key and values and get(print) the keys only in the Dictionary . key : 'a','b','c','d','e' Values : 10,20,30,40,50 QUESTION 4: -------------- QUESTION 4.1: -------------------- Description : Create a Dictionary with the below key and values and iterate Key : 10,20,30,40,50,60,10,50,40 Values : 101,202,303,404,505,606,101,505,404 QUESTION 4.2: -------------------- Description : Create a Dictionary with the below key and values and iterate Key : 'vel','Ganesh','Dinesh','Vengat','subash' Values : 'Selenium','framework','oracle','python','jira' QUESTION 4.3: -------------------- Description : Create a Dictionary with the below key and values and iterate Key : 10,20,30,40,50,60,10,50,40 Values : 10+10j,20+2j,30+3j,40+4j,50+5j,60+6j,10+10j,50+5j,40+4j QUESTION 5: ----------------- QUESTION 5.1: -------------------- Description : Add a key and value pair [10:sql] at the last position of Dictionary Key : 10, 20 ,30,40,50,60, Values : 'python','selenium','java','c','c++','oracle' QUESTION 5.2: -------------------- Description : Add a key and value pair [46.90 : 30] at the last position of Dictionary Key : 55.56, 98.65 , 35.09, 46.90 , 67.450 , 25.89 Values : 60,50,40,30,20,10 QUESTION 6: -------------------- QUESTION 6.1: -------------------- Description : Create a Dictionary with below key and Value and Remove the key [50] Key : 10 , 20 ,30,40,50,60, Values : 100,200,300,400,500,600 QUESTION 6.2: -------------------- Description : Create a Dictionary with below key and Value and Remove the key and value[10.9:python] pair Key : 10.9, 20.1 ,30.2,40.3,50.4,60.5, Values : 'python','selenium','java','c','c++','oracle' QUESTION 6.3: -------------------- Description : Create a Dictionary with below key and Value and Remove the key and value[Malaiyalam : Kerala] pair Key : 'Tamil','English','Malaiyalam','Telugu','Hindi','Kanadam' Values : 'TamilNadu','Uttar Pradesh','Kerala','Telangana','Delhi','Karnataka' QUESTION 7: ------------------ QUESTION 7.1: -------------------- Description : Create a Dictionary with below key and Value and Add the value(900) using " Slice " operator Key : 10 , 20 ,30,40,50,60, Values : 100,200,300,400,500,600 QUESTION 7.2: -------------------- Description : Create a Dictionary with below key and Value and Add the value(Mumbai) using " Slice " Operator Key : 'Tamil','English','Malaiyalam','Telugu','Hindi','Kanadam' Values : 'TamilNadu','Uttar Pradesh','Kerala','Telangana','Delhi','Karnataka' QUESTION 8: ------------------ QUESTION 8.1: -------------------- Description : print all value in list [[10,'vel','vel@gmail.com'],[20,'nisha','nisha@gmail.com'],[30,'bala','bala@gmail.com']] QUESTION 8.2: -------------------- Description : print all value in list [(10,'vel','vel@gmail.com'),(20,'nisha','nisha@gmail.com'),(30,'bala','bala@gmail.com')] QUESTION 8.3: -------------------- Description : print all value in list [{10,'vel','vel@gmail.com'},{20,'nisha','nisha@gmail.com'},{30,'bala','bala@gmail.com'}] QUESTION 8.4: -------------------- Description : print all value in list [{'id':10,'name':'vel','email':'vel@gmail.com'},{'id':20,'name':'nisha','email':'nisha@gmail.com'},{'id':30,'name':'bala','email':'bala@gmail.com'}] QUESTION 9: ------------------ QUESTION 9.1: -------------------- Description : print all value in tuple ([10,'vel','vel@gmail.com'],[20,'nisha','nisha@gmail.com'],[30,'bala','bala@gmail.com']) QUESTION 9.2: -------------------- Description : print all value in tuple ((10,'vel','vel@gmail.com'),(20,'nisha','nisha@gmail.com'),(30,'bala','bala@gmail.com')) QUESTION 9.3: -------------------- Description : print all value in tuple ({10,'vel','vel@gmail.com'},{20,'nisha','nisha@gmail.com'},{30,'bala','bala@gmail.com'}) QUESTION 9.4: -------------------- Description : print all value in list ({'id':10,'name':'vel','email':'vel@gmail.com'},{'id':20,'name':'nisha','email':'nisha@gmail.com'},{'id':30,'name':'bala','email':'bala@gmail.com'})