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

List of Important Programs-Python Programming

This document contains a list of important programs divided into 5 units - Python basics, strings, lists/tuples/dictionaries, file handling, and NumPy/Pandas. Some of the key programs listed include: writing a program to calculate addition, subtraction, multiplication and division of two numbers; checking if a number is prime; reversing a string; sorting a dictionary; reading and writing to files; performing arithmetic on NumPy arrays; and creating graphs and a calendar using Tkinter.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

List of Important Programs-Python Programming

This document contains a list of important programs divided into 5 units - Python basics, strings, lists/tuples/dictionaries, file handling, and NumPy/Pandas. Some of the key programs listed include: writing a program to calculate addition, subtraction, multiplication and division of two numbers; checking if a number is prime; reversing a string; sorting a dictionary; reading and writing to files; performing arithmetic on NumPy arrays; and creating graphs and a calendar using Tkinter.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

List of important Programs

Subject: Python Programming (BCC-302)

UNIT-1
1 Write a simple Python Program to INPUT two variables and print Addition, Subtraction,
Multiplication and Division of both numbers.
2 Write a python program to show the importance of operator precedence and associativity
of different operators
3 Python program to convert Celsius to Fahrenheit
4 Python program to solve quadratic equation
5 Python Program to Swap Two Variables
UNIT-2
1 Write a program Python Program to Find the Largest Among Three Numbers
2 Write Python code to find the factorial of a number.
3 Write a program to check an input year is leap year or not.
4 Program to check if a number is prime or not
5 Write a program to find the sum of n natural numbers
6 Write a Python Program for Sum the digits of a given number
7 Write a program to Reverse a given integer number and check whether its is palindrome
or not.
8 Write a recursive function to compute the factorial of an input number N.
9 Write a Python Program to check Armstrong Number
10 Write a Python Program for How to check if a given number is Fibonacci number.
11 Write a program which makes use of function to display all such numbers which are
divisible by 7 but are not a multiple of 5, between 1000 and 2000.
12 Write Python Programs to print following patterns.
1
010
10101
0101010
*
***
*****
*******
13 Write a Python program, triangle(N), that prints a right triangle having base and height
consisting of N * symbols as shown in these examples:
triangle(3) prints:
*
**
***
triangle(5) prints:
*
**
***
****
*****
14 Write a Python program to construct the following pattern, using a nested for loop.
*
**
***
*****
****
***
**
*
15 Write a Python Program to create a lambda function to do total of two values passed.
16 Write a module in Python to implement arithmetic calculator that has following user-
defined functions: add( ), sub( ), mul( ), div( ). Write a python program to import this
module and perform any operation.
17 Write a Python function, searchMany(s, x, k), that takes as argument a sequence s and
integers x, k (k>0). The function returns True if there are at most k occurrences of x in s.
Otherwise it returns False. For example:

searchMany([10, 17, 15, 12], 15, 1) returns True


searchMany([10, 12, 12, 12], 12, 2) returns False
searchMany([10, 12, 15, 11], 17, 18) returns True

UNIT-3
1 Write Python program to convert uppercase letter to lowercase and vice versa.
2 Python program to split and join a string.
3 Implement Python Script to perform various operations on string using string libraries
4 Write a program to check whether a string is a palindrome or not.
5 Write a program to find number of occurrences of each letter present in the given string
6 Write Python Program to count the number of characters in a string using dictionaries.
Display the keys and their values in alphabetical Order
7 Write a python program to count the vowels present in given input string. Explain the
output of program through example.
8 Write a program that accepts a sentence and calculate the number of digits, uppercase
and lowercase letters
9 Write a Python program to change a given string to a new string where the first and last
chars have been exchanged.
10 Write a program that accepts sequence of lines as input and prints the lines after making
all characters in the sentence capitalized. e.g. If Input: Hello world Practice makes
perfect Then, Output: HELLO WORLD PRACTICE MAKES PERFECT
11 Write a Python program to add an item in a tuple.
12 Write a Python program for Reversing a List
13 Write a Python program to find sum of elements in list
14 Write a Python program to find smallest / largest number in a list
15 Write a Python program to count Even and Odd numbers in a List
16 Write a Python Program to count unique values inside a list
17 Write a program to display unique vowels present in the given word.
18 Write a program to take a tuple of numbers from the keyboard and print its sum and
average.
19 Write a program to find number of occurrences of each letter present in the given string.
20 Write a program to enter name and percentage marks in a dictionary and display
information on the screen
21 Python Program to convert list to dictionary
22 Write a program to take dictionary from the keyboard and print the sum of values
23 Write Python code snippet to display n terms of Fibonacci series using recursion.
24 Write a program to sort a dictionary in ascending and descending order by key and value.
25 Write a python program to manage student’s details using dictionary.
26 Write a program to create three dictionaries and concatenate them to create fourth
dictionary.
UNIT-4
1 Write a Python program to remove newline characters from a file.
2 Write a Python program to read a file line-by-line store it into a variable.
3 Demonstrate the file handling procedure in detail. Write a python code to create a file
with ‘P.txt’ name and write your name and father’s name in this file and then read this
file to print it.
4 There is a file named Input.Txt. Enter some positive numbers into the file named
Input.Txt. Read the contents of the file and if it is an odd number write it to ODD.TXT
and if the number is even, write it to EVEN.TXT
5 Write a program to read the contents of file ‘message’ one character at a time. Print each
character that is read
6 Write a Python program to copy the contents of a file to another file .

7 Write a program to modify the pointer position using seek() method in Python.
UNIT-5
1 How will you obtain the type of elements, number of elements, base address and
number of bytes occupied by the following Numpy array. Explain with a suitable
code.
2 Python Program to Perform Arithmetic Operations on Array
3
4 Given the two matrices how would you add, subtract, multiply and divide
corresponding elements of these matrices?
5 Create a 50 element array and fill it with odd numbers starting from 1.
6 Write a Python program to draw a line with suitable label in the x axis, y axis and
a title
7 Write a Python programming to display a bar chart of the popularity of
programming Languages. Attach a text label above each bar displaying its
popularity (float value).
8 Write a Python programming to create a pie chart of gold medal achievements of
five most successful countries in 2016 Summer Olympics. Read the data from a
csv file
9 Create a MultiIndex with the names of each of the index levels in Python Pandas
10 Create a GUI Calendar using Tkinter
11 Create GUI digital clock using Tkinter

You might also like