0% found this document useful (0 votes)
35 views3 pages

Python Programming Lab Course Overview

The document outlines the Python Programming Lab course objectives and outcomes for students, emphasizing skills in core Python, object-oriented programming, GUI design, and database applications. It includes a list of 32 programming experiments that students are required to complete, ranging from basic input/output tasks to more complex functions and class implementations. Additionally, it provides references to textbooks and online resources for further learning.

Uploaded by

Prasanna Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views3 pages

Python Programming Lab Course Overview

The document outlines the Python Programming Lab course objectives and outcomes for students, emphasizing skills in core Python, object-oriented programming, GUI design, and database applications. It includes a list of 32 programming experiments that students are required to complete, ranging from basic input/output tasks to more complex functions and class implementations. Additionally, it provides references to textbooks and online resources for further learning.

Uploaded by

Prasanna Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Department of Computer Science and Engineering

Programme: Common to CSE,CAI,CSD,IT, & ECE Semester:II


Course Code Course Name L T P C
PYTHON PROGRAMMING Lab 0 0 3 1.5
Subject Category : ESC
Course Objectives:
The Objectives of Python Programming Lab is

• To acquire programming skills in core Python.


• To acquire Object Oriented Skills in Python.
• To develop the skill of designing Graphical user Interfaces in Python.
• To develop the ability to write database applications in Python.

Course Outcomes:
At the end of the Course, the student will be able to
CO 1: Write, Test and Debug Python Programs
CO 2: Use Conditionals and Loops for Python Programs
CO 3: Use functions and represent Compound data using Lists, Tuples and Dictionaries
CO 4: Use various applications using python

Experiments
1) Write a program that asks the user for a weight in kilograms and converts it to pounds.
There are 2.2 pounds in a kilogram.
2) Write a program that asks the user to enter three numbers (use three separate input
statements). Create variables called total and average that hold the sum and average of
the three numbers and print out the values of total and average.
3) Write a program that uses a for loop to print the numbers 8, 11, 14, 17, 20, . . . , 83,
86,89.
4) Write a program that asks the user for their name and how many times to print it. The
program should print out the user’s name the specified number of times.
5) Use a for loop to print a triangle like the one below. Allow the user to specify how high
the triangle should be.
*
**
***
****
6) Generate a random number between 1 and 10. Ask the user to guess the number and
print a message based on whether they get it right or not.
7) Write a program that asks the user for two numbers and prints Close if the numbers are
within .001 of each other and Not close otherwise.
8) Write a program that asks the user to enter a word and prints out whether that word
contains any vowels.
Department of Computer Science and Engineering

9) Write a program that asks the user to enter two strings of the same length. The program
should then check to see if the strings are of the same length. If they are not, the
program should print an appropriate message and exit. If they are of the same length,
the program should alternate the characters of the two strings. For example, if the user
enters abcde and ABCDE the program should print out AaBbCcDdEe
10) Write a program that asks the user for a large integer and inserts commas into it
according to the standard American convention for commas in large numbers. For
instance, if the user enters 1000000, the output should be1,000,000.
11) Write a program that generates a list of 20 random numbers between 1 and100.
(a) Print the list.
(b) Print the average of the elements in the list.
(c) Print the largest and smallest values in the list.
(d) Print the second largest and second smallest entries in the list
(e) Print how many even numbers are in the list.
12) Write a program to use split and join methods in the given string and store them in a
dictionary data structure.
13) Write a program that removes any repeated items from a list so that each item appears
at most once. For instance, the list [1,1,2,3,4,3,0,0] would become [1,2,3,4,0].
14) Write a program that asks the user to enter a length in feet. The program should then
give the user the option to convert from feet into inches, yards, miles, millimeters,
centimeters, meters, or kilometers. Say if the user enters a 1, then the program converts
to inches, if they enter a 2, then the program converts to yards, etc. While this can be
done with if statements, it is much shorter with lists and it is also easier to add new
conversions if you use lists.
15) Write a function called sum_digits that is given an integer num and returns the sum of
the digits of num.
16) Write a function called first_diff that is given two strings and returns the first location in
which the strings differ. If the strings are identical, it should return-1.
17) Write a function called number_of_factors that takes an integer and returns how many
factors the number has.
18) Write a function called is_sorted that is given a list and returns True if the list is sorted
and False otherwise.
19) Write a function called root that is given a number x and an integer n and returns x1/n.
In the function definition, set the default value of n to 2.
20) Write a function called merge that takes two already sorted lists of possibly different
lengths, and merges them into a single sorted list.
(a)Do this using the sort method. (b) Do this without using the sort method
21) Write a program that asks the user for a word and finds all the smaller words that can
be made from the letters of that word. The number of occurrences of a letter in a
smaller word can’t exceed the number of occurrences of the letter in the user’s word.
22) Write a program that reads a file consisting of email addresses, each on its own line.
Your program should print out a string consisting of those email addresses separated by
semicolons.
23) Write a program that reads a list of temperatures from a file called [Link], converts
those temperatures to Fahrenheit, and writes the results to a file [Link].
Department of Computer Science and Engineering

24) Write a class called Product. The class should have fields called name, amount, and
price, holding the product’s name, the number of items of that product in stock, and the
regular price of the product. There should be a method get_price that receives the
number of items to be bought and returns a the cost of buying that many items, where
the regular price is charged for orders of less than 10 items, a 10% discount is applied
for orders of between 10 and 99 items, and a 20% discount is applied for orders of 100
or more items. There should also be a method called make_purchase that receives the
number of items to be bought and decreases amount by that much.
25) Write a class called Time whose only field is a time in seconds. It should have a method
called convert_to_minutes that returns a string of minutes and seconds formatted as in
the following example: if seconds is 230, the method should return '5:50'. It should also
have a method called convert_to_hours that returns a string of hours, minutes, and
seconds formatted analogously to the previous method.
26) Write a Python class to implement pow(x,n).
27) Write a Python class to reverse a string word by word.
28) Write a program to demonstrate Try/except/else.
29) Write a function nearly _equal to test whether two strings are nearly equal. Two strings
a and b are nearly equal when a can be generated by a single mutation on b.
30) Write a python program to create wheel using turtle graphics.
31) Write a python program on GUI to create a Registration form.
32) Write a python program to check whether a string starts and ends with the same
character or not (using Regular Expression re module).

TEXT BOOKS:
1. Fundamentals of Python First Programs, Kenneth. A. Lambert,Cengage.
2. Learning Scientific Programming with Python, Christian Hill, Cambridge University
Press.

REFERENCE BOOKS:
1. Introduction to Python Programming, Gowrishankar.S, VeenaA, CRC Press.
2. Introduction to Programming Using Python, Y. Daniel Liang,Pearson.
3. ReemaThareja, Python Programming using problem solving Approach, Oxford
University Press 2017
4. R. NageswaraRao core python Programming second Edition.

E-RESOURCES:
1. [Link]
2. [Link]
3. [Link]

You might also like