Python Practical 987
Python Practical 987
:991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
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
Code:
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.
Code:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Output:
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Practical-2
a. Write a program that takes two lists and returns True if they have
at least one common member.
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Code:
Output:
c. Write a program to find even and odd nos from given list:
Code:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Practical-3
3)a.Take a list, say for example this one: a = [1, 1, 2, 3, 5, 8, 13, 21,
34,55,89]and write a program that prints out all the elements of the list
that are less than 5.
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Code:
Output:
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Practical-4
a. Write a Python script to sort (ascending and descending)
dictionary by value.
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Code:
Output:
Practical-6
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Code:
Output:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
Practical-7
Code:
Output:
CODE:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]
OUTPUT:
OUTPUT:
Roll no. :991
Name: Vishnu Vardhan Reddy
Class & Div: BSC.IT[C]