0% found this document useful (0 votes)
4 views

Grade_7_Python_Notes

The document provides Python programming exercises for Grade VII students at Bharati Vidyapeeth Rabindranath Tagore School of Excellence for the academic year 2023-24. It includes sample programs for determining positive or negative numbers, formatting strings, creating a calculator, calculating grades based on percentage, and checking leap years, among others. The exercises aim to enhance students' understanding of block-based to text-based programming in Python.

Uploaded by

talesofaalie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Grade_7_Python_Notes

The document provides Python programming exercises for Grade VII students at Bharati Vidyapeeth Rabindranath Tagore School of Excellence for the academic year 2023-24. It includes sample programs for determining positive or negative numbers, formatting strings, creating a calculator, calculating grades based on percentage, and checking leap years, among others. The exercises aim to enhance students' understanding of block-based to text-based programming in Python.

Uploaded by

talesofaalie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

BHARATI VIDYAPEETH RABINDRANATH TAGORE SCHOOL OF EXCELLENCE

ACADEMIC YEAR 2023-24

Name: _________________________ Grade: VII Div: ______ Date: ………………………

Subject: ICT Topic: Unit 7.1 : Block it out : Block-based to text-based


Python Notes

Sample Python Program


1. Accept a number from the user and display if it is a positive or a negative number.

n = float(input("Input a number: "))


if n >= 0:
if n == 0:
print("It is Zero!")
else:
print("Number is Positive number.")
else:
print("Number is Negative number.")

2. Write a Python program to print the following string in a specific format (see the output).
Sample String:
Twinkle, twinkle, little star,
How I wonder what you are!
Up above the world so high,
Like a diamond in the sky.
Twinkle, twinkle, little star,
How I wonder what you are

print("Twinkle, twinkle, little star, \n\tHow I wonder what you are! \n\t\tUp
above the world so high, \n\t\tLike a diamond in the sky. \nTwinkle, twinkle,
little star, \n\tHow I wonder what you are!")

Here, \n will bring the next text to new line. \t will leave indentation from the starting point.

3. Create a program to allow user for granting access to the system after they enter correct name.

Page | 1
4. Write a python program to create a Calculator which can perform 4 basic arithmetic operations.

5. Write a program to accept percentage from the user and display the grade according to the given
criteria.
Marks Grade
>90 A
>80 and <=90 B
>=60 and <=80 C
Below 60 D

6. Write a Python program to find the area and perimeter of rectangle.

7. Accept a number from the user and check if it is an odd or even number.

Page | 2
8. Accept the year of birth from the user and check if it is a leap year or not.

9. Create a python program to convert the temperature in degree centigrade to Fahrenheit.

10. Write a Python program to check from the age whether the person is senior citizen or not.

Page | 3

You might also like