0% found this document useful (0 votes)
4 views1 page

Python Programming Basics Worksheet

The document provides Python programming examples for basic tasks using the turtle module and simple input/output operations. It includes code snippets for drawing a circle and a square, calculating simple interest, determining pass/fail based on marks, and adding three numbers. Each example is clearly structured and demonstrates fundamental programming concepts.

Uploaded by

4purbadebna1h
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)
4 views1 page

Python Programming Basics Worksheet

The document provides Python programming examples for basic tasks using the turtle module and simple input/output operations. It includes code snippets for drawing a circle and a square, calculating simple interest, determining pass/fail based on marks, and adding three numbers. Each example is clearly structured and demonstrates fundamental programming concepts.

Uploaded by

4purbadebna1h
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

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)
-------------------------------------------------------------------------------------------------------------------

You might also like