Week - 3 Lab - 2 Lab Aim: Understand The Conditional Statements and Looping Statements of
Week - 3 Lab - 2 Lab Aim: Understand The Conditional Statements and Looping Statements of
Week - 3
Lab -2
Lab Aim: Understand the Conditional Statements and Looping Statements of
Python Programming
f. Also check whether the user given character is alphabet or digit or special
character. The first if statement checks whether the given character is
between a and z or A and Z. If TRUE, it is an alphabet. Otherwise, it
enters the elif statement where it checks whether a character is between 0
and 9. If True, it is a digit. Otherwise, it is a special character.
g. Simulate the following for understanding the working of loops in Python:
https://python-iitk.vlabs.ac.in/exp/loops/simulation.html
h. Develop a program to draw the following pattern
a. b.
h. Using a for loop, write a program that prints out the decimal equivalents
of 1/2, 1/3, 1/4, . . . , 1/10.
i. Each new term in the Fibonacci sequence is generated by adding the
previous two terms. By starting with 1 and 2, the first 10 terms will be: 1,
2, 3, 5, 8, 13, 21, 34, 55, 89 By considering the terms in the Fibonacci
sequence whose values do not exceed four million, find the sum of the
even-valued terms
Week - 4
Lab -3
Lab Aim: Understand and implement List, Tuple & Dictionary in python
programming:
b. Create a list in python for storing supermarket bill details and perform the
following operations on it:
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Python Programming Lab Manual
Faculty: Prof. Leena Nadkar
BTI Sem III - Div B,C,D
○ List indices
○ Add an item to the end of the list
○ Insert an item at a given position
○ Modify an element by using the index of the element
○ Remove an item from the list
○ Remove all items from the list
○ Slice Elements from a List
○ Remove the item at the given position in the list, and return it
○ Return the index in the list of the first item whose value is x
○ Return the number of times 'x' appear in the list
○ Sort the items of the list in place
○ Reverse the elements of the list in place
c. Create a tuple for storing student information and perform the following
functions:
○ Print an item of the tuple
○ Check if an element exists within a tuple
○ Check number of times an item has repeated
○ Remove an item from a tuple
○ Slice a tuple
○ Get the index of an item of the tuple
○ Print the size of a tuple
○ Modify items of a tuple