Python Question
Python Question
12) Python Program to add number till a negative number is given as an input
13) Python program for printing the binary equivalent of a number in stars
14) Python program for printing the binary equivalent of a number in stars in vertical
manner
15) Python program to print first letter of a sentence.
16) Python program to find hcf and lcm of the given numbers
17) Program for checking whether a given equation is balanced properly with brackets or
not.
18) Python program to print the following pattern
for n=6
19) Python program to print the following pattern
for n=6
1
12
123
1234
12345
31) Python program for finding the sum of the digit of a number
32) Python Program for printing sum of first n naturals numbers
33) Python Program to print sum of odd and even numbers of 1st naturals numbers
34) Python Program for printing sum of squares first n naturals numbers
35) Python Program to print the table of a number
36) Python Program for printing the following pattern
For n=5
1
22
333
4444
55555
37) Python Program to check weather a list is having all unique elements or not
38) Python program to convert binary to decimal number
39) Python program to convert decimal to binary number
40) Python program to remove duplicates from a string
42) Python program for finding the palindrome words from a given string.
Sample Input: - “Hi mom and dad”
Sample Output: - mom
Dad
46) Python program to print the occurrence of all word in a given string
Sample Input: - “Ram is good boy. Ram is doing well”
Sample Output: -
Word occurrence
Ram 2
is 2
good 1
boy 1
doing 1
well 1
47) Python program to find equivalent binary number of a decimal number using recursion
48) Python program to build a calculator using functions
49) Python program for checking special number
Sample Input: - 91
Sample Output: - 9+1=10, 1+0=1
: - 91 is a special number
50) Python program for printing special number in a given range
51) Python program to find factorial of a number using recursion
52) Python program for checking Neon number.
(A number is said to ‘Neon’, if sum of the digits of a square is equal to the number
itself.)
Sample Input: - 9
Sample Output: 9*9=81, 8+1=9
: 9 is a Neon Number
53) Python program to accept a number and display the new number after removing all
zeros.
Input: 54000270
Output: 5427
54) Python program to check whether the number is twisted or not.
(A prime number is said to be ‘Twisted Prime’, if the new number obtained after
reversing the digit is also a prime number.)
Sample Input: 167
Sample Output: - 761 is a prime number
167 is a twisted prime number
60) Python program to display sum of odd and even numbers with in given range.
Prepared by
Bharath TS