Python Practical

You might also like

You are on page 1of 11

Ques 1: Program to find the second largest element in a list ‘Num’.

Solution:

Output:

Ques 2: Write a Python code to delete all odd numbers and negative numbers from a
given numeric list.
Solution:
Output:

Ques 3: Python Program to Find Element Occurring Odd Number of Times in a List.
Solution:

Output:
Ques 4: Python Program to Check if a String is a Palindrome or Not.
Solution:

Output:

Ques 5: Check if the Substring is present in a Given String.


Solution:

Output:
Ques 6: Display Letters which are in the First String but not in the Second.
Solution:

Output:

Ques 7: Write a program that reads a string and then prints a string that capitalizes
every other letter in the string.
Solution:

Output:
Ques 8: Python Program to Remove the Given Key from a Dictionary.
Solution:

Output:
Ques 9: Python Program to Count the Frequency of Words Appearing in a String
Using a Dictionary.
Solution:

Output:
Ques 10: WAP to store student’s information like admission number, roll number,
name and marks in a dictionary and display information on the basis of
admission number.
Solution:

Output:
Ques 11: Write a program to arrange a list on integer elements in ascending order
using bubble sort technique.
Solution:

Output:

Ques 12: Write a program to compare two files and display total number of lines in a
file.
Solution:

Output:
Ques 13: Python Program to Count the Occurrences of a Word in a Text File.
Solution:

Output:

Ques 14: Python Program to Read a String from the User and Append it into a File.
Solution:

Output:
Ques 15: Write a program to determine whether a given string has balanced
parenthesis or not.
Solution:

Output:

Ques 16: Python Program to Find the Total Sum of a Nested List Using Recursion.
Solution:

Output:
Ques 17: Accept list and key as input and find the index of the key in the list using
linear search.
Solution:

Output:

You might also like