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

Python - Lab 2

This document contains details of a student named Salin Chaudhary's computer programming laboratory experiment involving variables, data types, operators, and expressions. The document outlines the objectives of the experiment, experimental procedure, sample programs and outputs for 4 questions involving exchanging variable values, calculating quotient and remainder, finding area and perimeter of a rectangle, and converting Celsius to Fahrenheit. It concludes that the student learned how to solve such problems using variables and basic concepts 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)
54 views

Python - Lab 2

This document contains details of a student named Salin Chaudhary's computer programming laboratory experiment involving variables, data types, operators, and expressions. The document outlines the objectives of the experiment, experimental procedure, sample programs and outputs for 4 questions involving exchanging variable values, calculating quotient and remainder, finding area and perimeter of a rectangle, and converting Celsius to Fahrenheit. It concludes that the student learned how to solve such problems using variables and basic concepts 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/ 12

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 2
Title of the Laboratory Exercise: Variables, data types, operators and expressions
1. Introduction and Purpose of Experiment
Variables are the basic data objects that are manipulated in a program. Every value in
Python has a data-type. Operators specify what is to be done to them. Expressions combine
variables and constants to produce new values. These building blocks are the topics of this
Lab. By solving the given programming problems, the students will be able to apply the
concepts of variables, data types, operators and expressions.
2. Aim and Objectives

Aim
 To develop programs using variables of basic data types and compute simple
expressions involving operators
Objectives
At the end of this lab, the student will be able to
 Use variables of the basic data types m
 Apply various operators in expressions
 Create Python programs to solve simple numeric problems
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 exchange the values of two variables using a temporary
variable.
b. Write a Python program to compute quotient and remainder of two numbers.
c. Write a Python program to find the area and perimeter of a rectangle.
d. Write a Python program to convert temperature in Celsius to Fahrenheit.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

5. Calculations/Computations/Algorithms

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:THE VALUES OF A AND B ARE SWAPPED USING A


VARIABLE
WHICH IS TEMP.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

PROGRAM 4)b.

OUTPUT 4)b.

ANALYSIS: WE GOT THE QUOTIENT AND THE REMAINDER FOR THE


ABOVE GIVEN NUMBERS.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

PROGRAM 4)c.

OUTPUT 4)c.

ANALYSIS: WE GOT THE AREA AND PERIMETER OF THE RECTANGLE


HAVING THE ABOVE LENGTH AND BREATH.
Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

PROGRAM 4)d.

OUTPUT 4)d.

ANALYSIS : HERE WE CONVERTED THE CELSIUS TO FAHRENHEIT.


Name: SALIN CHAUDHARY Registration Number: 21ETCS002173

7. Conclusions

Here we learnt 4 programs in which the first program was based on swapping values

between 2 variables using an another variable named temp. In the second program we

found out the quotient and remainder . In the third program we found out the area and

perimeter of a rectangle using 2 variables named as length and breath. In the fourth we

converted Celsius to Fahrenheit using the input as Celsius as input for the program.

You might also like