Python - Practical Manual SYIT
Python - Practical Manual SYIT
Programming with
Python – practical book
SYBSC(IT) SEM III
PRACTICAL 1
a) Create a program that asks the user to enter their name
and their age. Print out a message addressed to them that
tells them the year that they will turn 100 years old.
OUTPUT:
b) Enter the number from the user and depending on
whether the number is even or odd, print out an
appropriate message to the user.
OUTPUT:
c) Write a program to generate the Fibonacci series.
OUTPUT:
d) Write a function that reverses the user defined value.
OUTPUT:
e) Write a function to check the input value is Armstrong
and also write the function for Palindrome.
OUTPUT:
f) Write a recursive function to print the factorial for a
given number.
OUTPUT:
PRACTICAL 2
a) Write a function that takes a character (i.e. a string of
length 1) and returns True if it is a vowel, False otherwise.
OUTPUT:
b) Define a function that computes the length of a given
list or string.
OUTPUT:
c)Define a procedure histogram () that takes a list of
integers and prints a histogram to the screen. For example,
histogram ([4, 9, 7]) should print the following:
****
*********
*******
OUTPUT:
PRACTICAL 3
a) A pangram is a sentence that contains all the letters of
the English alphabet at least once, for example: The quick
brown fox jumps over the lazy dog. Your task here is to
write a function to check a sentence to see if it is a
pangram or not.
OUTPUT:
b) Take a list, say for example this one:
a= [8,3,5] and write a program that prints out all the
elements of the list that are less than 5.
OUTPUT: