MODULE - 2
ASSIGNMENT
Please do not use GenAI (e.g. ChatGPT) for solving assignments and do not copy and paste from the
internet. Understand the solution using GenAI or the internet if you want to but you have to answer in
your own words. Also do not copy solutions from your friends or batchmates.
Our plagiarism tool on LMS will identify such things and make a record that you are following unethical
means to solve assignments. Without any notice we shall just discard your name from any internship or
job assistance from our side.
Ethics is the number one quality which we all must possess. Thank You
Data Types
Please implement it by using Python.
1. Construct 2 lists containing all the available data types (integer, float, string, complex
and Boolean) and do the following..
a. Create another list by concatenating above 2 lists
b. Find the frequency of each element in the concatenated list.
c. Print the list in reverse order.
2. Create 2 Sets containing integers (numbers from 1 to 10 in one set and 5 to 15 in other
set)
a. Find the common elements in above 2 Sets.
b. Find the elements that are not common.
c. Remove element 7 from both the Sets.
3. Create a data dictionary of 5 states having state name as key and number of covid-19
cases as values.
a. Print only state names from the dictionary.
b. Update another country and its covid-19 cases in the dictionary.
© 360DigiTMG. All Rights Reserved.
Operators
Please implement by using Python
1. A. Write an equation which relates 399, 543 and 12345
B. “When I divide 5 with 3, I get 1. But when I divide -5 with 3, I get -2”—How would
you justify it?
2. a=5,b=3,c=10.. What will be the output of the following:
A. a/=b
B. c*=5
3. A. How to check the presence of an alphabet ‘S’ in the word “Data Science” .
B. How can you obtain 64 by using numbers 4 and 3 .
Variables
Please implement by using Python
1. What will be the output of the following (can/cannot):
a. Age1=5
b. 5age=55
2. What will be the output of following (can/cannot):
a. Age_1=100
b. age@1=100
3. How can you delete variables in Python ?
© 360DigiTMG. All Rights Reserved.