Class 12 Python(083) Practical File (2024–25)

Vijaya Kumar Chinthala
6 min readOct 19, 2020

--

LIST OF PROGRAMS:

Program 1: Program to enter two numbers and print the arithmetic operations like +,-,*, /, // and %.

Program 2: Write a program to find whether an inputted number is perfect or not.

Program 3: Write a Program to check if the entered number is Armstrong or not.

Program 4: Write a Program to find factorial of the entered number.

Program 5: Write a Program to enter the number of terms and to print the Fibonacci Series.

Program 6: Write a Program to enter the string and to check if it’s palindrome or not using loop.

Program 7: Read a file line by line and print it.

Program 8: Remove all the lines that contain the character “a” in a file and write it into another file.

Program 9: Read a text file and display the number of vowels/consonants/uppercase/lowercase characters in the file.

Program 10 Create a binary file with name and roll no. Search for a given roll number and display the name, if not found display appropriate message.

Program 11 Write a random number generator that generates random numbers between 1 and 6(simulates a dice)

Program 12 Write a python program to implement a stack using a list data structure.

Program 13 Read a text file line by line and display each word separated by a #

Program 14 Create a student table and insert data. Implement the following SQL commands on the student table:

ALTER table to add new attributes / modify data type / drop attribute

UPDATE table to modify data

ORDER By to display data in ascending / descending order

DELETE to remove tuple(s)

GROUP BY and find the min, max, sum, count and average

Program 15:Integrate SQL with Python by importing the Pymysql module

Program 1: Program to enter two numbers and print the arithmetic operations like +,-,*, /, // and %.

Output:

Program 2: Write a program to find whether an inputted number is perfect or not.

Output:

Program 3: Write a Program to check if the entered number is Armstrong or not.

Output:

OR

Output:

Program 4: Write a Program to find factorial of the entered number.

Output:

Program 5: Write a Program to enter the number of terms and to print the Fibonacci Series.

Output:

Program 6: Write a Program to enter the string and to check if it’s palindrome or not using loop.

Output:

OR

Output:

OR

Output:

Yes

Program 7: Read a file line by line and print it.

Assume we have the following file, located in the same folder as Python:

Output:

Program 8: Remove all the lines that contain the character “a” in a file and write it into another file.

Assume we have the following file, located in the same folder as Python:

Output:

Program 9: Read a text file and display the number of vowels/consonants/uppercase/lowercase characters in the file.

Actual text file

Output:

Program 10 Create a binary file with name and roll no. Search for a given roll number and display the name, if not found display appropriate message.

Output:

OR

Output:

Program 11 Write a random number generator that generates random numbers between 1 and 6(simulates a dice)

Output:

Program 12 Write a python program to implement a stack using a list data structure.

Stack Concept:

Output:

Program 13 Read a text file line by line and display each word separated by a #

Output:

Program 14 Create a student table and insert data. Implement the following SQL commands on the student table:

ALTER table to add new attributes / modify data type / drop attribute

UPDATE table to modify data

ORDER By to display data in ascending / descending order

DELETE to remove tuple(s)

GROUP BY and find the min, max, sum, count and average

Program 15:Integrate SQL with Python by importing the pymysql module

--

--

Responses (1)