Skip to content

Prerna084/task-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

#Task-1#

#Write Python program to create Gl list, a dictionary, and a set. Perform basic operations like adding, removing, and modifying elements.

#Created a List# my_list = [11,12,13,14,15] #Created a Set# my_set = f11,12,13,14,15) #Created a Dictionary# my_dict - ('R': 11,'U': 12,'C': 13,'H': 14, 'I': 15) #Printing the Primary values# print("Primary List:", my_list) print("Primary Set:", my_set) print("Primary Dictionary:", my_dict) #Performing_Basic_Operations# #Adding an element to the List# my_list.append(16) #Adding an element to the Set# my_set.add(17) #Adding a key-value pair from the Dictionary# my_dict['E']=18 #Removeing an element from the List# my_list.remove(12) #Removeing an element from the Set# my_set. remove(14) #Removeing a key-value pair from the Dictionary# del my_dict['C"] #Modifying an element in the List# my_list[3]= 110 #Modifying an element in the Set# my_set.update((82)) #odifying a value in the Dictionary# my_dict['I']= 36 #Printing the Final values# print("Updated List:", my_list) print("Updated Set:", my_set) print("Updated Dictionary:", my_dict)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages