Professional Documents
Culture Documents
Programming SAU 2 2
Programming SAU 2 2
1 {1,3,5,7}
1.2 TRUE
1.3 TRUE
result_union_method = x.union(y)
4. result_intersection_method = setx.intersection(sety)
{“blue”}
5. 3
6. [3,4,5,’a’]
7 Lists allow duplicate elements. You can have the same values multiple times in a list. Sets do now allow
duplicate elements. Each element un a set is unique
8. SET – b, LIST – a
9. pear
10. Nothing
11. print(fruits[1])
user_list = []
user_list.append(name)
user_list.append(age)
user_list.append(country)
print("\nUser Information:")
print("Name:", user_list[0])
print("Age:", user_list[1])
12.
if not numbers:
else:
max_index = 0
max_num = numbers[i]
max_index = i