Class XII Practical Program Algorithm
Class XII Practical Program Algorithm
NO: 1
MENU DRIVEN PROGRAM TO PERFORM ARITHMETIC OPERATIONS
Alogrithm:
EX.NO: 2
Algorithm:
EX.NO: 3
Step7: If the condition is False loop will forwards elif condition and execute the body of the statements.
EX.NO: 4
CREATING A PYTHON PROGRAM TO IMPLEMENT RETURNING VALUE(S)
FROM FUNCTION
Algorithm:
EX.NO:5
Algorithm:
Step4: Pass values to the called function and return the value
Algorithm:
Step7:If the condition is true print the number else if the condition is false break the program
EX.NO:7
Algorithm:
Step5:Split the words from the line by using the split() function
Algorithm:
EX.NO:9
Algorithm:
Ex.No :10
CREATING A PYTHON PROGRAM TO COPY PARTICULAR LINES OF A TEXT FILE
INTO AN ANOTHER TEXT FILE
Algorithm:
Step2: Open the document and set access mode through file handle name
Step3: Read all the lines from the document by using readlines() function
Step5: Check the conditions whether any one of the condition is fulfilled
Ex.No :11
Aim:
Algorithm:
Step5: Open the document and set access mode through file handle name
Step6: Check the condition and execute the body of the statements
Step7: Obtain the input values from the user through input statements
Step9: Write the list of elements into documents by using the dump () function
Step10: Obtain the input values from the user through input statements
Step11: Close the documents through file handle name.
Step13: Obtain the input values from the user through input statements
Step15: If the condition becomes True, the body of the statement will be executed respectively, whereas
if the condition becomes false control will forward to another block
EX.NO: 12
Aim:
Algorithm:
Step5: Open the document and set access mode through file handle name
Step6: Check the condition and execute the body of the statements
Step7: Obtain the input values from the user through input statements
Step9: Write the list of elements into documents by using the dump () function
Step10: Obtain the input values from the user through input statements
Step13: Obtain the input values from the user through input statements
EX.NO: 13
Aim:
To create a python program to create and search employee’s record in csv file.
Algorithm:
Step5: Open the document and set access mode through file handle name
Step6: Check the condition and execute the body of the statements
Step7: Obtain the input values from the user through input statements
Step9: Write the list of elements into documents by using the dump () function
Step10: Obtain the input values from the user through input statements
Step13: Obtain the input values from the user through input statements
Step15: If the condition becomes True, the body of the statement will be executed respectively,
Aim:
Algorithm:
EX.NO: 15
Algorithm:
Ex.No:16
Algorithm:
Step3: Define a Create_DB() function and Create_Table() function with an appropriate statements .
Step4: Establish a connection in between MySQL and python though connection object name
Step 5: Check the connection whether the python and MySQL connected or not
Step 4: If the conditions is true activate the cursor by using the cursor() function and execute the
SQL queries
Step6: Check the choices, If the choice becomes true body of the statement has to be executed