Python Prgs for record class 9th
Python Prgs for record class 9th
PYTHON PROGRAMS
# Personal Information
name = "John Doe"
f_name = "Michael Doe"
c_name = "10th Grade"
s_name = "Springfield High School"
# Print the information
print("Personal Information:")
print("Name:", name)
print("Father's Name:", f_name)
print("Class:", c_name)
print("School Name:", s_name)
------------------------------------------------------------------------------------------------------------
● To find the sum of two numbers 15 and 20.
Flowchart:
# Define the numbers
num1 = 15
num2 = 20
# Calculate the sum
sum_result = num1 + num2
# Print the result
print("The sum of", num1, "and", num2, "is:", sum_result)
O/P: 5x1=5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
------------------------------------------------------------------------------------------------------------
● To calculate Simple Interest if the principle_amount = 2000 rate_of_interest = 4.5 time = 10
# Define the values
principle_amount = 2000
rate_of_interest = 4.5
time = 10
# Calculate Simple Interest
simple_interest = (principle_amount * rate_of_interest * time) / 100
# Print the result
print("The Simple Interest is:", simple_interest)