Python Syllabus
Python Syllabus
Python Syllabus
Python P
C
Version No. 1.0
Course Pre-requisites/ None
Co-requisites
File I/O-Opening and Closing files, Different modes, File attributes, Read, Write
Operations, File Positions. Renaming and Deleting Files, various directory handling
functions.
Text Books
References
Week 1:
Week 2:
Week 3:
Week 4:
1. Write a program which will find all such numbers which are divisible by 7 but are not a
multiple of 5, between 2000 and 3200 (both included).
The numbers obtained should be printed in a comma-separated sequence on a single line.
Consider use range(#begin, #end) method
2. Write a python program to check whether a number is divisible by 5 and 11 or not.
3. Write a python program to check whether a character is alphabet or not.
4. Write a python program to input any character and check whether it is alphabet, digit or
special character.
5. Write a python program to check whether a character is uppercase or lowercase
alphabet.
6. Write a python program to input week number and print week day.
7. Write a python program to count total number of notes in given amount
Week 5:
1. Write a Python program to print all natural numbers from 1 to n. - using while loop
2. Write a Python program to find sum of all odd numbers between 1 to n.
3. Write a Python program to count number of digits in a number.
4. Write a Python program to find first and last digit of a number.
5. Write a Python program to calculate sum of digits of a number.
6. Write a Python program to enter a number and print its reverse.
Week 6:
Week 7:
1. Write a Python Program to Find the Largest Number in a List
2. Write a Python Program to Find the Second Largest Number in a List
3. Write a Python Program to Put Even and Odd elements in a List into Two Different
Lists
4. Write a Python Program to Merge Two Lists and Sort it
5. Write a Python Program to Sort the List According to the Second Element in
Sublist
6. Write a Python Program to Find the Second Largest Number in a List Using
Bubble Sort
7. Write a Python Program to Sort a List According to the Length of the Elements
8. Write a Python Program to Find the Union of two Lists
9. Write a Python Program to Find the Intersection of Two Lists
10. Python Program to print all odd indexed elements of a list
Week 8:
1. Write a Python program to get the 4th element and 4th element from last of a tuple
2. Write a Python program to find the repeated items of a tuple.
3. Write a Python program to check whether an element exists within a tuple
4. Write a Python program to unzip a list of tuples into individual lists.
5. Write a Python program to replace last value of tuples in a list.
Sample list: [(10, 20, 40), (40, 50, 60), (70, 80, 90)]
Expected Output: [(10, 20, 100), (40, 50, 100), (70, 80, 100)]
6. Write a Python program to remove an empty tuple(s) from a list of tuples.
Sample data: [(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), ('d')]
Expected output: [('',), ('a', 'b'), ('a', 'b', 'c'), 'd']
7. Write a Python program to convert a list of tuples into a dictionary.
8. Write a Python program to find the highest 3 values of corresponding keys in a
dictionary.
Week 9:
1. Write a Python function that prints out the first n rows of Pascal's triangle.
2. Write a Python function to create and print a list where the values are square of numbers
between 1 and 30 (both included).
3. Write a Python program to detect the number of local variables declared in a function
4. Write a Python program that invoke a given function after specific milliseconds.
5. Write a Python program to get the sum of a non-negative integer
Week 10:
Week 11:
1. Write a Python Program to Replace all Occurrences of ‘a’ with ‘b’ in a String. If
‘a’ is not present then print appropriate message.
2. Write a Python Program to Remove the nth Index Character from a Non-Empty
String
3. Write a Python Program to Detect if Two Strings are Anagrams
4. Write a Python Program to Form a New String where the First Character and the
Last Character have been Exchanged.
Week 12:
1. Write a Python program to get the last part of a string before a specified character
2. Write a Python program to count the occurrences of each word in a given sentence.
3. Write a Python function to insert a string in the middle of a string.
4. Write a Python function to get a string made of its first three characters of a specified
string. If the length of the string is less than 3 then return the original string.
5. Write a Python program to add a prefix text to all of the lines in a string
6. Write a Python program to convert a given string into a list of words.
Recommended by the
Board of Studies on
Date of Approval by the
Academic Council