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

Practical Record1

The document outlines three Python programming tasks: calculating the net run rate for a tournament, classifying characters, and finding the largest among three numbers. Each task includes an aim, a description of what to accomplish, and the corresponding code. Additionally, it specifies that the output of each code must be printed and copied.
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)
8 views3 pages

Practical Record1

The document outlines three Python programming tasks: calculating the net run rate for a tournament, classifying characters, and finding the largest among three numbers. Each task includes an aim, a description of what to accomplish, and the corresponding code. Additionally, it specifies that the output of each code must be printed and copied.
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

Left Side Right Side

Use only Pencil for


FLOWCHART: flow chart drawing
and writing Calculator – Net Run Rate (NRR)
AIM:
To become familiar with the usage of variables, data types,
comments, arithmetic operators, input(), and print().
TASK:
Write a python program to compute the net run rate for a
tournament.
CODE:
#Input runs scored and runs conceded
runs_scored = int(input("Enter total runs scored: "))
OUTPUT: overs_batted = float(input("Enter total overs batted: "))
runs_conceded = int(input("Enter total runs conceded: "))
overs_bowled = float(input("Enter total overs bowled: "))

# Calculate net run rate


The code's output has to
net_run_rate = (runs_scored / overs_batted) - (runs_conceded / overs_bowled)
be printed and copied
here. # Display the result
print("Net Run Rate:", net_run_rate)
Left Side Right Side

FLOWCHART:
Character Classification Program
Use only Pencil for
flow chart drawing AIM:
and writing Learn how to make decisions in their code based on different conditions
and become familiar with built-in methods for string manipulation and
validation.
TASK:
Write a python program to check whether given character is space, digit,
uppercase letter, lowercase letter or special character.

CODE:
# Input the character to check
ch=input("Enter Any Character:")
# Checking whether it is upperletter or lowerletter or digit or a special character
if ch.isupper():
print(ch, " is an upper case letter")
elif ch.islower():
print(ch, " is a lower case letter")
elif ch.isdigit():
print(ch, " is a digit")
elif ch.isspace():
OUTPUT: print(ch, " is a space")
else:
The code's output has to be
print(ch," is a special character")
printed and copied here.
Left Side Right Side

FLOWCHART:
Find the Largest among 3 number
Use only Pencil for
AIM:
flow chart drawing
and writing To become familiar with comparison operators, data types specifically
integers, and learn how to convert user input from strings to integers for
numerical operations.
TASK:
Write a python program to find greatest among 3 numbers.

CODE:
#Take input or three number to compare
n1=int(input("Enter the Number1:"))
n2=int(input("Enter the Number2:"))
n3=int(input("Enter the Number3:"))
if n1>n2 and n1>n3:
print(n1, " - N1 is greater")
elif n2>n1 and n2>n3:
OUTPUT: print(n2, " - N2 is greater")
elif n3>n1 and n3>n2:
print(n3, " - N3 is greater")
else:
The code's output has to be print("All are same")
printed and copied here.

You might also like