0% found this document useful (0 votes)
22 views1 page

Lab Activity 5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views1 page

Lab Activity 5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Name: Score: Name: Score:

Course & Section: Course & Section:

Laboratory Activity # 5 Laboraory Activity # 5

Problem 1: Sum of Even Numbers

Problem 1: Sum of Even Numbers Write a program that takes a list of integers as input and prints the sum of
all even numbers in the list.
Write a program that takes a list of integers as input and prints the sum of all
even numbers in the list. Problem 2: Count Elements in a Tuple

Problem 2: Count Elements in a Tuple Write a program that takes a tuple of integers as input and a specific
number. The program should print how many times the number occurs in
Write a program that takes a tuple of integers as input and a specific number.
the tuple.
The program should print how many times the number occurs in the tuple.
Problem 3: Find Union and Intersection
Problem 3: Find Union and Intersection
Write a program that takes two sets as input and prints their union and
Write a program that takes two sets as input and prints their union and
intersection.”
intersection.”
Problem 3: Find Union and Intersection
Problem 3: Find Union and Intersection
Write a program that takes two sets as input and prints their union and
Write a program that takes two sets as input and prints their union and
intersection.”
intersection.”
Problem 4: Dictionary
Problem 4: Dictionary
students = {'Alice': 85, 'Bob': 90}
students = {'Alice': 85, 'Bob': 90}
1. Add a new key-value pair to a dictionary.
1. Add a new key-value pair to a dictionary.
2. Deletes a key from the dictionary.
2. Deletes a key from the dictionary.
3. Prints the updated dictionary.
3. Prints the updated dictionary.
Problem 5: Essay
Problem 5: Essay Explain the differences between lists, tuples, sets, and dictionaries in
Python
Explain the differences between lists, tuples, sets, and dictionaries in Python

You might also like