0% found this document useful (0 votes)
15 views4 pages

PGM List 2

The document contains a list of programming tasks that include inputting numbers to perform various calculations, such as squaring, checking positivity, grading based on percentage, determining prime status, calculating areas and perimeters, and more. Each task outlines specific requirements and expected outcomes, such as printing results or determining properties of numbers and shapes. Overall, the document serves as a guide for creating basic programs in Python.

Uploaded by

Sharmila Begum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

PGM List 2

The document contains a list of programming tasks that include inputting numbers to perform various calculations, such as squaring, checking positivity, grading based on percentage, determining prime status, calculating areas and perimeters, and more. Each task outlines specific requirements and expected outcomes, such as printing results or determining properties of numbers and shapes. Overall, the document serves as a guide for creating basic programs in Python.

Uploaded by

Sharmila Begum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1.

Write a program to input a number and


print its square if it is odd, otherwise print
its square root.

2. Write a program to input a number and


check whether it is positive, negative or
zero.

3. Write a program to input percentage


marks of a student and find the grade as per
the following criterion:
Marks Grade
>=90 A
75-90 B
60-75 C
Below 60 D
4. Write a program to enter a number and
check if it is a prime number or not.

5. Write a program to display a menu for


calculating the area of the circle or
perimeter of the circle.

6. Write a program that reads two


numbers and an arithmetic operator and
displays the computed result.

7. Write a program to print whether a


given character is an uppercase or a
lowercase character or a digit or any other
character.
8. Write a program to calculate and print
the roots of a quadratic equation
ax²+bx+c=0.(a≠0)

9. Write a program to print the sum of


natural numbers between 1 to 7. Print the
sum progressively i.e. after adding each
natural number, a print sum so far.

10. Write a program to calculate the


factorial of a number.

11. Write a program to create a triangle of


stars using a nested loop.

12. Write a Python script to print Fibonacci


series’ first 20 elements.
13. Write a program to read an
integer>1000 and reverse the number.

14. Input three angles and determine if they


form a triangle or not.

You might also like