0% found this document useful (0 votes)
209 views

Module 2 Data Types, Operators, Variables Assignment

The document contains instructions for Python exercises on data types, operators, and variables. For data types, the exercises involve creating lists of data types, concatenating lists, finding frequencies, and reversing a list. For operators, the exercises involve relating numbers with equations, performing division and multiplication operations, and checking for strings in words. For variables, the exercises involve assigning values to valid and invalid variable names and deleting variables.

Uploaded by

Teja venkat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
209 views

Module 2 Data Types, Operators, Variables Assignment

The document contains instructions for Python exercises on data types, operators, and variables. For data types, the exercises involve creating lists of data types, concatenating lists, finding frequencies, and reversing a list. For operators, the exercises involve relating numbers with equations, performing division and multiplication operations, and checking for strings in words. For variables, the exercises involve assigning values to valid and invalid variable names and deleting variables.

Uploaded by

Teja venkat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Module – 2 ASSIGNMENT

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.

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 .

© 360DigiTMG. All Rights Reserved.


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.

You might also like