140+ Python Program

140+ Python Program. 


Python Programming Questions


Program 1: Write a Python program to print "Hello Python". 

Program 2: Write a Python program to do arithmetical operations addition and division. 

Program 3: Write a Python program to find the area of a triangle. 

Program 4: Write a Python program to swap two variables. 

Program 5: Write a Python program to generate a random number. 

Program 6: Write a Python program to convert kilometers to miles. 

Program 7: Write a Python program to convert Celsius to Fahrenheit. 

Program 8: Write a Python program to display calendar. 

Program 9: Write a Python program to solve quadratic equation. 

Program 10: Write a Python program to swap two variables without temp variable. 

Program 11: Write a Python Program to Check if a Number is Positive, Negative or Zero. 

Program 12: Write a Python Program to Check if a Number is Odd or Even. 

Program 13: Write a Python Program to Check Leap Year. 

Program 14: Write a Python Program to Check Prime Number. 

Program 15: Write a Python Program to Print all Prime Numbers in an Interval of 1-10. 

Program 16: Write a Python Program to Find the Factorial of a Number. 

Program 17: Write a Python Program to Display the multiplication Table. 

Program 18: Write a Python Program to Print the Fibonacci sequence. 

Program 19: Write a Python Program to Check Armstrong Number? 

Program 20: Write a Python Program to Find Armstrong Number in an Interval. 

Program 21: Write a Python Program to Find the Sum of Natural Numbers. 

Program 22: Write a Python Program to Find LCM. 

Program 23: Write a Python Program to Find HCF. 

Program 24: Write a Python Program to Convert Decimal to Binary, Octal and Hexadecimal. 

Program 25: Write a Python Program To Find ASCII value of a character. 

Program 26: Write a Python Program to Make a Simple Calculator with 4 basic mathematical operations. 

Program 27: Write a Python Program to Display Fibonacci Sequence Using Recursion. 

Program 28: Write a Python Program to Find Factorial of Number Using Recursion. 

Program 29: Write a Python Program to calculate your Body Mass Index. 

Program 33: Write a Python Program to find largest element in an array. 

Program 43: Write a Python program to check if the given number is a Disarium Number. 

Program 44: Write a Python program to print all disarium numbers between 1 to 100. 

Program 45: Write a Python program to check if the given number is Happy Number. 

Program 55: Write a Python program to print even numbers in a list. 

Program 56: Write a Python program to print odd numbers in a List. 

Program 68: Write a Python program to find the sum of all items in a dictionary. 

Program 69: Write a Python program to Merging two Dictionaries. 

Program 70: Write a Python program to convert key-values list to flat dictionary. 

Program 71: Write a Python program to insertion at the beginning in OrderedDict. 

Program 72: Write a Python program to check order of character in string using OrderedDict(). 

Program 73: Write a Python program to sort Python Dictionaries by Key or Value. 

Program 74: Write a program that calculates and prints the value according to the given formula: Following are the fixed values of C and H: C is 50. H is 30. D is the variable whose values should be input to your program in a comma-separated sequence. 

Program 75: Write a program which takes 2 digits, X,Y as input and generates a 2-dimensional array. 

Program 76: Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated sequence after sorting them alphabetically. 

Program 77: Write a program that accepts a sequence of whitespace separated words as input and prints the words after removing all duplicate words and sorting them alphanumerically. 

Program 79: Write a program that accepts a sentence and calculate the number of letters and digits. 

Program 99: Create a function that replaces all the vowels in a string with a specified character. 

Program 100: Write a function that calculates the factorial of a number recursively. 

Program 103: The "Reverser" takes a string as input and returns that string in reverse order, with the opposite case. 

Program 104: You can assign variables from lists like this: lst = [1, 2, 3, 4, 5, 6] first = lst[0] middle = lst[1:-1] last = lst[-1] print(first) ➞ outputs 1 print(middle) ➞ outputs [2, 3, 4, 5] print(last) ➞ outputs 6. 

Program 107: Create a function that takes a string and returns a string in which each character is repeated once. 

Program 108: Create a function that reverses a boolean value and returns the string "boolean expected" if another variable type is given. 

Program 114: Create a function that takes the height and radius of a cone as arguments and returns the volume of the cone rounded to the nearest hundredth. 

Program 115: This Triangular Number Sequence is generated from a pattern of dots that form a triangle. 

Program 116: Create a function that takes a list of numbers between 1 and 10 (excluding one number) and returns the missing number. 

Program 122: Create a function that takes three arguments (x, y, z) and returns a list containing numbers from x to y, that are divisible by z. 

Program 123: Create a function that takes in two lists and returns True if the second list follows the first list by one element, and False otherwise. 

Program 128: Given a string of numbers separated by a comma and space, return the product of the numbers. 

Program 129: Create a function that squares every digit of a number. 

Program 137: Create a function that takes three integer arguments (a, b, c) and returns the amount of integers which are of equal value. 

Program 138: Write a function that converts a dictionary into a list of keys-values tuples. 




Post a Comment

0 Comments