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

Unit-2 Python Assignment

Uploaded by

jasik54191
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

Unit-2 Python Assignment

Uploaded by

jasik54191
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
You are on page 1/ 1

Assignment Python Programming(UNIT-2)

1. Write a Python program to check whether a number entered by the user is positive,
negative, or zero.
2. Write a Python program to input marks of a student and print the grade according to
given conditions.
3. Write a Python program to print the first 10 natural numbers using a for loop.
4. Write a Python program to print the multiplication table of a number entered by the user
using range().
5. Write a Python program to count the number of vowels in a given string.
6. Write a Python program to find the sum of all elements in a list using a for loop.
7. Write a Python program to print all keys and values from a dictionary using a for loop.
8. Write a Python program to print numbers from 1 to 20 using a while loop.
9. Write a Python program to keep asking the user for a number until they enter a negative
number.
10. Write a Python program that loops through numbers from 1 to 10 but does nothing when
the number is 5 .
11. Write a Python program that prints numbers from 1 to 10 but skips printing 4 and 7 .
12. Write a Python program that keeps taking numbers from the user until the number 0 is
entered .
13. Write a Python program that checks if a given number is prime using a loop with else.
14. Write a Python program to print a pattern of stars in increasing order (nested loops).
15. Write a Python program for a simple calculator that takes two numbers and an operator
from the user and performs the operation until the user chooses to exit.

You might also like