Python Lecture 4
Python Lecture 4
2. You are given a list of subjects for students. Assume one classroom is required for 1
subject. How many classrooms are needed by all students.
”python”, “java”, “C++”, “python”, “javascript”,
“java”, “python”, “java”, “C++”, “C”
Ans: Take all the elements on a set. And count the len(set)…
LETS PRACTICE
3. enter marks of 3 subjects from the user and store them in a dictionary. Start with
an empty dictionary & add one by one. Use subject name as key & marks as value.
LETS PRACTICE
4. Figure out a way to store 9 & 9.0 as separate values in the set.
(You can take help of built-in data types)