It Essentials and Python Programming Lab(20-21)
It Essentials and Python Programming Lab(20-21)
Implement the following in Python: (Any Six activities should be carried out)
1. Basics of Python:
A. Write a program to display the statements.
B. Write a program to demonstrate the basic data types in python.
C. Write a program to format string and numbers.
D. Write a program to demonstrate the inbuilt Math function.
E. Write a program to compute arithmetic operations taking input from the user and display
the result.
F. Write a program to translate mathematical formulae into equivalent python expressions.
G. Write a program to demonstrate bitwise and logical operators.
H. Write a program to swap two numbers without using a temporary variable.
4. Lists:
A. Write a program to create a list and perform the following operations:
i. + ii. * iii. Slicing iv. del
B. Write a program to perform any 6 built-in functions by taking any list.
C. Write a program to create and display n x n matrix.
D. Write a program to get a list of even numbers from a given list of numbers.(use only
comprehensions)
E. Write a program to calculate the length of each element in a list using map function in
python.
5. Tuples:
A. Write a program to create tuples (name, age, address, college) for at least two members and
display the concatenation of tuples and print the first tuple n number of times.
B. Write a program to return the top n’s most frequently occurring chars and their respective
counts. e.g. aaaaaabbbbcccc, 2 should return [(a 6) (b 4)].
C. Write a program to create n iterables of varied sizes and group the values using zip function
in python.
6. Sets & Dictionaries:
A. Write a program to create two sets and perform the following operations:
i. Union ii. Intersection iii. Difference iv. Asymmetric Difference
B. Write a program to check whether the given set is a subset or superset of another set.
C. Write a program to generate a dictionary that contains numbers (between 1 and n) in the
form of (x,x*x).
D. Write a program to check if a given key exists in a dictionary or not.
E. Write a program to add a new key-value pair to an existing dictionary.
F. Write a program to sum all the items in a given dictionary.
7. Write a program to check whether a given number has an even number of 1’s in its binary
representation (No control flow allowed).
Reference Books:
1. Sheetal Taneja, Naveen Kumar, Python Programming A modular Approach with Graphics,
Database, Mobile, and Web Applications, 5th Edition, Pearson India Education Services Pvt.
Ltd, 2019.
2. Ashok N Kamthane, Amit Ashok Kamthane, Programming and Problem Solving with Python,
1st Edition, McGraw Hill Education (India), 2018.
3. Sander van Vugt, Beginning the Linux Command Line, 2nd Edition, Apress Publishers, 2015.
Web References:
1. https://www.pcsuggest.com/basic-linux-commands/
2. https://www.linuxtechi.com/25-find-command-examples-for-linux-beginners/
3. https://gsuite.google.com/learning-center/products/#!/
4.https://www.techsoup.org/support/articles-and-how-tos/eleven-tips-for-troubleshooting-software
5. https://www.vmware.com/pdf/VMwarePlayerManual10.pdf
●