Grade_7_Python_Notes
Grade_7_Python_Notes
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
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.
10. Write a Python program to check from the age whether the person is senior citizen or not.
Page | 3