Python Questions
Python Questions
7. Print a pyramid and a half pyramid pattern using the asterisk in a program.
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.
14.Write 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
15.Write 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.
16.Write a Python program to test whether a passed letter is a vowel or not
17.Write a Python program that will accept the base and height of a triangle and
compute the area.
18.Write a Python program to sum of three given integers. However, if two
values are equal sum will be zero
19.Write a Python program to sum of two given integers. However, if the sum
is between 15 to 20 it will return 20.
20.Write a Python program to display your details like name, age, address in
three different lines.
27.Given two integer numbers return their product only if the product is equal
to or lower than 1000, else return their sum.
28.Write a program to display the first 10 numbers and in each iteration, print
the sum of the current and previous number.
47.Write a program that asks the user to enter a weight in kilograms. The
program should convert it to pounds
48.Ask the user to enter a year, determine how many leap years there have
been between 1600 and that year.
49.Write 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.
50.Write a program which will find the numbers divisible by 7 but not divisible
by 5