Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
36 views

Python - Lab 3

This document contains details of a student's laboratory experiment on input and output operations in Python. It includes the aim, objectives, procedure, sample programs and questions to calculate average of 3 numbers, display a calendar, perform operations on complex numbers, and calculate square, cube and factorial of a number. The student provides the Python code, sample outputs, and analyses the programs to demonstrate understanding of input/output functions in Python.

Uploaded by

salin chaudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Python - Lab 3

This document contains details of a student's laboratory experiment on input and output operations in Python. It includes the aim, objectives, procedure, sample programs and questions to calculate average of 3 numbers, display a calendar, perform operations on complex numbers, and calculate square, cube and factorial of a number. The student provides the Python code, sample outputs, and analyses the programs to demonstrate understanding of input/output functions in Python.

Uploaded by

salin chaudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

Computer Programming Laboratory


B. Tech. 1st Semester

Name : SALIN CHAUDHARY


Roll Number :21ETCS002173
Department : Computer Science and Engineering

Faculty of Engineering & Technology


Ramaiah University of Applied Sciences
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173
Ramaiah University of Applied Sciences
Private University Established in Karnataka State by Act No. 15 of 2013

Faculty Engineering & Technology

Programme B. Tech. in Computer Science and Engineering

Year/Semester 1st Year /1st Semester


Name of the Laboratory Computer Programming Laboratory
Laboratory Code 21CSS106A

List of Experiments

1. Introduction to Python programming environment


2. Variables, data types, operators and expressions
3. Input output operations
4. Logic operations and decision making
5. Loop statements
6. Character and string operations
7. Functions
8. File handling
9. Data structures
10. Libraries
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

Laboratory 3
Title of the Laboratory Exercise: Input Output operations
1. Introduction and Purpose of Experiment
Python provides the Input-Output facilityto interact with the user. Some of the functions
such asinput() and print() are widely used for standard input and output operations
respectively. By solving the problems, students will be able to develop programs to read
input from screen and display output to the screen.

2. Aim and Objectives


Aim
 To develop programs involving input output operations
Objectives
At the end of this lab, the student will be able to
 Apply input and output operations

3. Experimental Procedure
i. Analyse the problem statement
ii. Design an algorithm for the given problem statement and develop a
flowchart/pseudo-code
iii. Implement the algorithm in Python language
iv. Execute the Python program
v. Test the implemented program
vi. Document the Results
vii. Analyse and discuss the outcomes of the experiment

4. Questions
a. Write a Python program to accept three numbers from the user (in a single line
separated by spaces) and display their average.
b. Write a Python program to display the calendar of the given month and year.
c. Write a Python program to accept two complex numbers from the user and display
their sum, difference and product.
d. Write a Python program to enter an integer number and perform the following
operations (use built in methods) on the integer
 Square, Cube, and Factorial
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

5.Calculations/Computations/Algorithms

FLOWCHARTS
4)a.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

4)b.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

4)c.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

4)d.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

6. Presentation of Results
PROGRAM 4)a.

OUTPUT 4)a.

ANALYSIS : HERE WE TAKE 3 NUMBERS AS INPUTS AND WE PRODUCE THE AVERAGE OF THE
THREE NUMBERS.

PROGRAM 4)b.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

OUTPUT
4)b.

ANALYSIS :
HERE WE
TAKE INPUT AS THE M AS MONTH AND Y AS YEAR AND GIVE THE CALENDER FOR THAT
MONTH AND YEAR.

PROGRAM 4)c.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

OUTPUT 4)c.

ANALYSIS : HERE WE TAKE THE INPUTS AS A AS REAL PART AND B AS IMAGINARY PART OF
THE COMPLEX NUMBER AND HENCE FIND THE SUM , DIFFERENCE AND PRODUCT OF THE
COMPLEX NUMBERS.

PROGRAM 4)d.

OUTPUT
4)d.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

ANALYSIS : HERE WE TAKE A NUMBER FROM THE USER AND FIND THE SQUARE , CUBE AND
FACTORIAL OF THAT NUMBER.

7.Conclusions
WE HAVE EXECUTED 4 PROGRAMS IN WHICH THE FIRST PROGRAM IS USED
TO CALCULATE THE AVERAGE OF THREE NUMBERS USING 3 VARIABLES SUCH AS
A,B,C.
IN THE SECOND PROGRAM WE HAVE PRODUCED A CALENDER USING USER INPUTS
SUCH AS
M AND Y. IN THE THIRD PROGRAM WE HAVE FOUND THE SUM , DIFFERENCE AND
PRODUCT
OF THE COMPLEX NUMBER USING THE USER INPUTTED REAL AND IMAGINARY
PARTS .
IN THE FOURTH PROGRAM WE HAVE FOUND THE SQUARE , CUBE AND ALSO
FACTORIAL OF
USER INPUTTED NUMBER.

You might also like