

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


#task 1 #nums = [1, 2, 2, 3, 4, 4, 5] #unique_nums = list(set(nums)) #print(unique_nums) #task #text = "hello hello world" #words = text.split() #counts = {} #or word in words:
#print(counts) #task #strs = ['eat', 'tea', 'tan', 'ate', 'nat', 'bat'] #anagram_map = {} #for word in strs:
#result = list(anagram_map.values()) #print(result) #task #nums = [1, 3, 4, 5] #n = 5 #full_set = set(range(1, n + 1)) #current_set = set(nums) #missing_id = list(full_set - current_set)[0] #print(f"Missing ID: {missing_id}") #task #inventory = {"ID001": ("Laptop", 1200, 5),"ID002": ("Mouse", 25, 50)} #target_id = "ID001" #new_qty = 10 #item_data = inventory[target_id] #name = item_data[0] #price = item_data[1] #inventory[target_id] = (name, price, new_qty) #total_value = sum(item[1] * item[2] for item in inventory.values()) #print(f"Updated Inventory for {target_id}: {inventory[target_id]}")
#print(f"Total Inventory Value: {total_value}")