Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
43 views

Python Lab Internals

The document contains a 12-week curriculum for a Python programming course. It includes topics such as basics of Python, operations, lists and tuples, sets dictionaries and strings, functions and multi-dimensional lists, exceptions, modules and inheritance, files, NumPy, Pandas, SciPy, GUI programming, and digital logic systems. Exercises are provided for each topic to help students learn and practice the concepts covered.

Uploaded by

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

Python Lab Internals

The document contains a 12-week curriculum for a Python programming course. It includes topics such as basics of Python, operations, lists and tuples, sets dictionaries and strings, functions and multi-dimensional lists, exceptions, modules and inheritance, files, NumPy, Pandas, SciPy, GUI programming, and digital logic systems. Exercises are provided for each topic to help students learn and practice the concepts covered.

Uploaded by

vnraids
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Week -1: Basics

i) Use a web browser to go to the Python website http://python.org. This page


contains information about Python and links to Python-related pages, and it gives you
1 the ability to search the Python documentation.
ii) Start the Python interpreter and type help() to start the online help utility.

2 Start a Python interpreter and use it as a Calculator

3 Write a program to purposefully raise Indentation Error and correct it

4 i) Write a program to calculate compound interest when principal, rate and number of periods are given.
ii) Given coordinates (x1, y1), (x2, y2) find the distance between two points

5 Read name, address, email and phone number of a person through keyboard and print the details.

Week - 2: Operations
Print the below triangle using for loop.
5
44
333
2222
6 11111

7 Write a program to check whether the given input is digit or lowercase character or uppercase character or a special character (use 'if-else-if' ladder)

8 Python Program to Print the Fibonacci sequence using while loop

9 Python program to print all prime numbers in a given interval (use break)

10 Write a program to compute LCM of two numbers by taking input from the user

11 Write a program add.py that takes 2 numbers as command line arguments and prints its sum
Week - 3: Lists & Tuples

i) Write a program to convert a list and tuple into arrays.


12 ii) Write a program to find common values between two arrays.

13 Write a function called gcd that takes parameters a and b and returns their greatest common divisor.

Write a function called palindrome that takes a string argument and returns True if it is a palindrome and False otherwise. Remember that you can
14 use the built-in function len to check the length of a string.

15 Find mean, median, mode for the given set of numbers in a list.

16 Write a Python program to create a tuple

17 Write a Python program to create a tuple with different data types.

18 Write a Python program to check whether an element exists within a tuple

Week - 4: Sets, Dictionaries and Strings

19 Write a function called is_sorted that takes a list as a parameter and returns True if the list is sorted in ascending order and False otherwise.

Write a function called has_duplicates that takes a list and returns True if there is any element that appears more than once. It should not modify
the original list. i). Write a function called remove_duplicates that takes a list and returns a new list with only the unique elements from the original.
Hint: they don’t have to be in the same order. ii). The wordlist I provided, words.txt, doesn’t contain single letter words. So you might want to add
“I”, “a”, and the empty string. iii). Write a python code to read dictionary values from the user. Construct a function to invert its content. i.e., keys
20 should be values and values should be keys.
i) Add a comma between the characters. If the given word is 'Apple', it should
become 'A,p,p,l,e'
ii) Remove the given word in all the places in a string?
iii) Write a function that takes a sentence as an input parameter and replaces the first
letter of every 21 word with the corresponding upper case letter and the rest of the letters in the word
by corresponding letters in lower case without using a built-in function?
21

22 Writes a recursive function that generates all binary strings of n-bit length

23 Write a Python program to implement all set operations

24 Write a program to check whether a string is palindrome or not

Week - 5: Functions and Multi-D Lists


i) Write a python program that defines a matrix and prints
ii) Write a python program to perform addition of two square matrices
25 iii) Write a python program to perform multiplication of two square matrices

26 Simple Calculator program by making use of functions

27 Find the factorial of a number using recursion

28 Write a function cumulative_ product to compute cumulative product of a list of numbers.

29 Write a function reverse to print the given list in the reverse order.

Week-6: Exceptions in Python

30 Write a program that detects an Exception

31 Write a program that raise an Exception ( divide by zero error,voter’s age validity
32 Write a program that raise an Exception as string(), student mark range validation)

33 Use the structure of exception handling all general purpose exceptions.

34 Write a python code to read a phone number and email-id from the user and validate it for correctness.

Week-7: Modules and Inheritance


How do you make a module? Give an example of construction of a module using different geometrical shapes and operations on them as its
35 functions.
a. Write a function called draw_rectangle that takes a Canvas and a Rectangle as
arguments and draws a representation of the Rectangle on the Canvas.
b. Add an attribute named color to your Rectangle objects and modify
draw_rectangle so that it uses the color attribute as the fill color.
c. Write a function called draw_point that takes a Canvas and a Point as arguments
and draws a representation of the Point on the Canvas.
d. Define a new class called Circle with appropriate attributes and instantiate a few
Circle objects. Write a function called draw_circle that draws circles on the canvas.
36

37 Write a Python program to demonstrate the usage of Method Resolution Order (MRO) in multiple levels of Inheritance.

Week- 8: Files

38 Write a Python code to merge two given file contents into a third file.

39 Write a Python code to open a given file and construct a function to check for given words present in it and display on found.

40 Write a Python code to Read text from a text file, find the word with most number of occurrences

41 Write a function that reads a file file1 and displays the number of words, number of vowels, blank spaces, lower case letters and uppercase letters.

42 Write a program to print each line of a file in reverse order.


Week - 9: Exploration of NumPy Package

43 Import numpy, and explore their functionalities.

44 a) Install NumPy package with pip and explore it.

45 Write a program for slicing arrays using numpy

46 Write a program for Math operations on array using numpy

47 Write a program for searching

48 Write a program for sorting

Week - 10: Exploration of Pandas Package

49 Import Pandas and Plotpy and explore their functionalities

50 Python Data Frame

51 Python series

Week - 11: Exploration of SciPy and GUI

52 Import SciPy and explore their functionalities

53 Write a GUI program to create a window wizard having two text labels, two text fields and two buttons as Submit and Reset.

Week-12: Digital Logic Systems

54 Write a program to implement Digital Logic Gates – AND, OR, NOT, EX-OR

55 Write a program to implement Half Adder, Full Adder, and Parallel Adder

You might also like