








































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A python program that creates a menu-driven program to perform basic arithmetic operations (+, -, *, /) based on the user's choice. The program allows the user to select an operation from a menu and then prompts for two numbers to perform the selected operation. The program then displays the result of the operation. The source code, sample outputs, and verification of the program's successful execution. This document could be useful for students learning python programming, particularly in the areas of control structures, functions, and basic arithmetic operations.
Typology: Study Guides, Projects, Research
1 / 48
This page cannot be seen from the preview
Don't miss anything!









































CBSE Affiliation No: 1930353 Kangayam Road, Tirupur – 641 606 Name ……………………………………………………………………………………………………………………………………………………… Register No …………………………………………………………….. Year ………………………………………………………………….. School ………………………………………………………………………………………………………………………………………………………. This is Certified to be the bonafide work of the student in this Laboratory and submitted for the practical examination held on ……………………………… at ……………………………………………………………………………….. …………………………………………….. Principal/H.M
Teacher – in – charge …………………………………………….. Internal Examiner
External Examiner
EXPT.NO (^) DATE CONTENTS PAGE NO TEACHER’S INITIAL 1 CREATING^ A^ MENU^ DRIVEN PROGRAM^ TO PERFORM ARITHMETIC OPERATIONS 2 CREATING^ A^ PYTHON^ PROGRAM^ TO^ DISPLAY^ FIBONACCI SERIES 3 CREATING^ A^ MENU^ DRIVEN^ PROGRAM^ TO^ FIND^ FACTORIAL AND SUM OF LIST OF NUMBERS USING FUNCTION 4 CREATING A PYTHON PROGRAM TO IMPLEMENT MATHEMATICAL FUNCTIONS 5 USER DEFINED FUNCTION WITH PARAMETERS (^6) COUNTING NUMBER OF WORDS IN DATA FILE 7 CREATING^ A^ PYTHON^ PROGRAM^ TO^ GENERATE^ RANDOM NUMBER BETWEEN 1 TO 6 8 CREATING^ A^ PYTHON^ PROGRAM^ TO^ READ^ A^ TEXT^ FILE^ LINE BY LINE AND DISPLAY EACH WORD SEPARATED BY '#' 9 CREATING A PYTHON PROGRAM TO READ A TEXT FILE AND DISPLAY THE NUMBER OF VOWELS/CONSONANTS/LOWER CASE/ UPPER CASE CHARACTERS 10 CREATING A PYTHON PROGRAM TO COPY PARTICULAR LINES OF A TEXT FILE INTO AN ANOTHER TEXT FILE 11 CREATING A PYTHON PROGRAM TO CREATE AND SEARCH RECORDS IN BINARY FILE 12 CREATING^ A^ PYTHON^ PROGRAM^ TO^ CREATE^ AND UPDATE/MODIFY RECORDS IN BINARY FILE 13 CREATING^ A^ PYTHON^ PROGRAM^ TO^ CREATE^ AND^ SEARCHI EMPLOYEE’S RECORD IN CSV FILE 14 CREATING^ A^ PYTHON^ PROGRAM^ TO^ IMPLEMENT^ STACK OPERATIONS
To write a menu driven Python Program to perform Arithmetic operations (+,-*, /) based on the user’s choice. SOURCE CODE:
Python Program Executed Output: Run – 1: RUN- 2 Result: Thus, the above Python program is executed successfully and the output is verified.
Python Executed Program Output: RUN - 1: RUN - 2 : Result: Thus, the above Python program is executed successfully and the output is verified.
To write a menu driven Python Program to find Factorial and sum of list of numbers using function. SOURCE CODE:
To write a Python program to implement python mathematical functions to find: (i) To find Square of a Number. (ii) To^ find^ Log^ of^ a^ Number(i.e.^ Log 10 ) (iii) To find Quad of a Number SOURCE CODE:
Python Executed Program Output: Result: Thus, the above Python program is executed successfully and the output is verified.
Program to count number of words in data file data.txt SOURCE CODE: file1=open("data.txt","r") line=" " count= while line: line=file1.readline() s=line.split() for word in s: count+= print("Number of words=",count) file1.close() Given Input: Emerging technologies are technologies whose development, practical applications, or both are still largely unrealized. These technologies are generally new but also include older technologies finding new applications. Emerging technologies are often perceived as capable of changing the status quo. SAMPLE OUTPUT: Result: Thus, the above Python program is executed successfully and the output is verified.
To write a Python program to generate random number between 1 to 6 to simulate the dice. SOURCE CODE: SAMPLE OUTPUT: Python Executed Output Program: Result: Thus, the above Python program is executed successfully and the output is verified
To write a Python Program to read a text file "Story.txt" and displays the number of Vowels/ Consonants/ Lowercase / Uppercase/characters in the file. SOURCE CODE:
Story.txt: Result: Thus, the above Python program is executed successfully and the output is verified.
Python Executed Program Output: New.txt: Result: Thus the above Python program is executed successfully and the output is verified.
To write a Python Program to Create a binary file with roll number and name. Search for a given roll number and display the name, if not found display appropriate message. SOURCE CODE: