0% found this document useful (0 votes)
3 views3 pages

Python Worksheet 1.1

The document is a worksheet for a student named Garvit Budhiraja, detailing programming exercises in Python. It includes three source code examples: performing arithmetic operations on two numbers, calculating total, average, and percentage of marks from five subjects, and converting length from centimeters to meters and kilometers. The worksheet is dated February 14, 2023, and is part of a Programming in Python Lab course.

Uploaded by

Garvit Budhiraja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Python Worksheet 1.1

The document is a worksheet for a student named Garvit Budhiraja, detailing programming exercises in Python. It includes three source code examples: performing arithmetic operations on two numbers, calculating total, average, and percentage of marks from five subjects, and converting length from centimeters to meters and kilometers. The worksheet is dated February 14, 2023, and is part of a Programming in Python Lab course.

Uploaded by

Garvit Budhiraja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

WORKSHEET 1.

WORKSHEET :-1.1
Student Name: Garvit Budhiraja UID: 21BCS6895
Branch: CSE Section/Group: 716/A
Semester: 4th Date of Performance: 14/02/2023
Subject Name: Programing in Python Lab Subject Code: 21CSP259

1. Aim: Writing python program in various modes and printing and assigning
the values to the variables

2. Source Code:
CODE 1: WAP to enter 2 numbers and perform all the arithmetic operations.

print("Name:- Garvit")
print("UID:-21BCS6895")
a = int(input("Enter the Value of First Variable"))
b = int(input("Enter the Value of Second Variable"))
print("Addition of the value is ", a+b)
print("Subtraction of the value is " , a-b)
print("Multiplication of the values is ", a*b)
print("division of the values is ", a/b)
print("Modulous of the values is" , a%b)

CODE 2: WAP to enter marks of 5 subjects and calculate its total, average
and percentage

print("Name:- Garvit")
print("UID:-21BCS6895")
value1 = int(input("Enter the marks for subject 1 "))
value2 = int(input("Enter the marks for subject 2 "))
value3 = int(input("Enter the marks for subject 3 "))
value4 = int(input("Enter the marks for subject 4 "))
value5 = int(input("Enter the marks for subject 5 "))
total =value1+value2+value3+value4+value5
print("Total marks in the five subjects are",total)
average = total/5
print("Average marks of the five subjects are", average)
percentage = (total/500)*100
print("The Percentage of the following marks is", percentage)

CODE 3: WAP to enter length in cm and convert it into meter(m) and kilo
meter (km) also convert the same into equivalents.

print("Name:- Garvit")
print("UID:-21BCS6895")
value1 = int(input("Enter the value in centimetre"))
value2 = value1/100
value3 = value2/1000
print("The value in centimetre is ",value1)
print("The value in metre is ",value2)
print("The value in Killometre is ", value3)

3. Screenshot of Outputs:

1:-
2:-

3:-

You might also like