[Go to site: main page, start]

0% found this document useful (0 votes)
30 views5 pages

Python Programming Exercises List

Uploaded by

Hardik
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)
30 views5 pages

Python Programming Exercises List

Uploaded by

Hardik
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

1.

Execute the python program to check whether the input string is a


palindrome or not.
2. Execute the program to find the factorial of a number.

3. Execute a program to print a Fibonacci series.


4. Execute the program to check whether a number is an Armstrong number or
not.

5. Execute the program to create a calculator


6. Print a pyramid and a half pyramid pattern using the asterisk in a program.

7. Print a pyramid and a half pyramid pattern using the asterisk in a program.

8. program to check if a year is a leap year or not?


9. Execute the program to check if the number is a prime number or not.
[Link] to Find Even Numbers between 100 to 1000

[Link] to Find Odd Numbers between 100 to 1000


[Link] a Python program which accepts the radius of a circle from the user
and compute the area.

13. Write a Python program which accepts the user's first and last name and
print them with a space between them. Also count vowels in those names.
[Link] a Python program to get the difference between a given number and
17, if the number is greater than 17 return double the absolute difference

[Link] a Python program to find whether a given number (accept from the
user) is even or odd, print out an appropriate message to the user.
[Link] a Python program to test whether a passed letter is a vowel or not

[Link] a Python program that will accept the base and height of a triangle and
compute the area.
[Link] a Python program to sum of three given integers. However, if two
values are equal sum will be zero

[Link] a Python program to sum of two given integers. However, if the sum
is between 15 to 20 it will return 20.
[Link] a Python program to display your details like name, age, address in
three different lines.

[Link] a Python program to sum of the first n positive integers


[Link] a Python program to calculate sum of digits of a number.

[Link] a Python program to sort three integers without using conditional


statements and loops.
[Link] a Python program to count the number occurrence of a specific
character in a string

[Link] a Python program to swap two variables.


[Link] a Python program to check if a number is positive, negative or zero.

[Link] two integer numbers return their product only if the product is equal
to or lower than 1000, else return their sum.
[Link] a program to display the first 10 numbers and in each iteration, print
the sum of the current and previous number.

[Link] numbers divisible by 5 from a 1 to 50


[Link] the following pattern

[Link] multiplication table for 7


[Link] downward Half-Pyramid Pattern with Star

[Link] first 10 numbers using a for loop


[Link] sum of all even numbers from 10 to 20

[Link] the square of each number from 1 to 10

[Link] Program to Find the Largest Among Three Numbers

[Link] Program to Check Armstrong Number


[Link] Program to Find the Sum of Natural Numbers

[Link] Program to Reverse a Number


[Link] program to check whether the given integer is a multiple of 5

[Link] program to check whether the given integer is a multiple of


both 5 and 7
[Link] program to find the average of 10 numbers using while loop
[Link] program to display all the multiples of 3 within the range 10
to 50
[Link] program to display all integers within the range 100-200
whose sum of digits is an even number

[Link] program to generate the prime numbers from 1 to N


[Link] is printed by the following code fragment?
a=0
while a < 100:
print(a)
a += 1
print()
What is the output for the above code as well as do this program using for
loop instead of while loop

[Link] a program that asks the user to enter a weight in kilograms. The
program should convert it to pounds
[Link] the user to enter a year, determine how many leap years there have
been between 1600 and that year.

[Link] a program that asks the user to enter a length in centimeters. If the user
enters a negative length, the program should tell the user that the entry is
invalid. Otherwise, the program should convert the length to inches and print
out the result.
[Link] a program which will find the numbers divisible by 7 but not divisible
by 5

You might also like