Work sheet 1 (Python Program)
-------------------------------------------------------------------------------------------------------------------
(1) Draw a circle: using python Module
import turtle
t=[Link]()
[Link](100)
[Link]()
-------------------------------------------------------------------------------------------------------------------
(2) Draw a square: using python Module
import turtle
t = [Link]()
for _i in range(4):
[Link](100)
[Link](90)
[Link]()
-------------------------------------------------------------------------------------------------------------------
(3) WAP to input principal, rate and time, calculate, and print
simple interest.
principal = float(input('Enter the principal amount: '))
rate = float(input('Enter the rate of interest p.a.: '))
time = float(input('Enter the time period in years: '))
simple_interest = principal * rate * time / 100
print('Simple Interest:',simple_interest)
-------------------------------------------------------------------------------------------------------------------
(4) Determine if a student passed or failed based on marks.
marks = int(input("Enter marks: "))
if marks >= 40:
print("Pass")
else:
print("Fail")
-------------------------------------------------------------------------------------------------------------------
(5) WAP to add 3 numbers.
a = int(input('Enter a number: '))
b = int(input('Enter another number: '))
c = int(input('Enter another number: '))
sum = a + b + c
print('Sum of the numbers you entered is:',sum)
-------------------------------------------------------------------------------------------------------------------