Operators Expressions and Python Statements

Python : Operators Expressions and Python Statements Program List




Program [1]

Write a Program to obtain temperature in Celsius and convert it into Fahrenheit using formula –

C X 9/5 + 32 = F


View Solution


Program [2]

WAP to read todays date (only date Part) from user. Then display how many days are left in the current month.


View Solution


Program [3]

WAP to print the area of circle when radius of the circle is given by user.


View Solution


Program [4]

WAP to print the volume of a cylinder when radius and height of the cylinder is given by user.

area =πr2h


View Solution


Program [5]

WAP that asks your height in centimeters and converts it into foot and inches.


View Solution


Program [6]

WAP to accept 3 side of triangle and find area of a triangle.


View Solution


Program [7]

WAP to input principle amount,rate time and calculate simple interest.


View Solution


Program [8]

WAP to read a number in n and prints n^2, n^3, n^4


View Solution


Program [9]

WAP to calculate compound simple interest after taking the principle, rate and time.


View Solution


Program [10]

WAP to take two numbers and check that the first number is fully divisible by second number or not.


View Solution


Program [11]

WAP to take value of x,y,z from the user and calculate the equation 


View Solution


Program [12]

WAP to take the temperatures of all 7 days of the week and displays the average temperature of that week.


View Solution


Program [13]

WAP to check the given year is leap year or not.


View Solution


Program [14]

WAP that searches for prime numbers from 15 through 25.


View Solution


Program [15]

WAP to test if given number is prime or not.


View Solution


Program [16]

WAP to compute the result when two numbers and one operator is given by user.


View Solution


Program [17]

WAP to calculate the roots of a given quadratic equation.


View Solution


Program [18]

WAP to input a digit and print it in words.


View Solution


Program [19]

WAP to check whether square root of a given number is prime or not.


View Solution


Program [20]

WAP to print first n odd numbers in descending order.


View Solution


Program [21]

WAP to find the average of the list of the numbers entered through keyboard.


View Solution


Program [22]

WAP to find the largest number from the list of the numbers entered through keyboard.


View Solution


Program [23]

WAP to find the sum of n natural numbers.


View Solution


Program [24]

WAP to find the sum of first n even numbers.


View Solution


Program [25]

WAP to find the sum of first n odd numbers.


View Solution


Program [26]

WAP a program to generate a list of elements of Fibonacci Series.


View Solution


Program [27]

Program to find the simple interest based upon number of years. If number of years is more than 12 rate of interest is 10 otherwise 15.


View Solution


Program [28]

Write a program to input any choice and to implement the following.

Choice Find

1. Area of square

2. Area of rectangle

3. Area of triangle


View Solution


Program [29]

Write a program to input any number and to print all natural numbers up to given number.


View Solution


Program [30]

Write a program to input any number and to find sum of all natural numbers up to given number.


View Solution


Program [31]

Write a program to input any number and to find reverse of that number.


View Solution


Program [32]

Write a program to input any string and count number of uppercase and lowercase letters.


View Solution


Program [33]

Python program to obtain three numbers and print their sum.


View Solution


Program [34]

Python program to obtain length and breath of a rectangle and calculate its area


View Solution


Program [35]

Python program to calculate (BMI) body mass index of a person

Body Mass Index is a simple calculation using a person's height and weight. The formula is BMI=kg/m^2 where kg is a person's weight in kilogram and m^2 is the height in meter squared.


View Solution


Program [36]

Write a program to input a number and print its cube.


View Solution


Program [37]

Write a program to input two number and swap them.


View Solution


Program [38]

Write a program to input three numbers and swap them as this : 1st number becomes the 2nd number, 2nd number becomes the 3rd number and 3rd number becomes the first number.


View Solution


Program [39]

Write a program to read three numbers in three variables and swap first two variables with the sums of first and second ,second and third number respectively.


View Solution


Program [40]

Write a program to input a single digit(n) and print a 3 digit number created as <n(n+1)(n+2)> e.g., if you input 7, then it should print 789. Assume that the input digit is in range 1-7.


View Solution


Program [41]

Write a program to accept a integer number from user and find its sum of digit.

Sample 1:

Input : 123

Output : Sum of Digit : 6

Sample 2:

Input : 1234

Output : Sum of Digit : 10


View Solution


Program [42]

Write a python program to accept a integer number and count the number of digits in number.

Sample:

Input: 2223

Output: Number of Digits: 4


View Solution


Program [43]

Write a Python program to accept a integer number form user and find the factorial value of input number.

The factorial of a number is the product of all the integers from 1 to that number. For example, the factorial of 6 is 1*2*3*4*5*6 = 720 . Factorial is not defined for negative numbers, and the factorial of zero is one, 0! = 1 .

Sample:

Input : 5

Output : 120


View Solution


Program [44]

Write a Python program to input any number and print all factors of input number.

A factor is a number that divides into another number exactly and without leaving a remainder.

Sample:

Input : 12

Output : Factor of 12 are : 1,2,3,4,6 ,12 


View Solution


Program [45]

Write a Python program to accept a integer number from user and check number is composite Number or not.

Composite number is a whole numbers that have on 1 or more than 1 factors excluding 1 and itself.  


View Solution


Program [46]

Write a python program to accept a integer number form user and find the largest digit of number.

Sample:

Input : 12341

Output : Largest Digit is : 4


View Solution


Program [47]

Write a python program to accept a integer number form user and find the smallest digit of number.

Sample:

Input : 12341

Output : Smallest Digit is : 1


View Solution


Program [48]

write a program to print the table of a given number. The number has to be entered by the user.


View Solution


Program [49]

Write a program to Calculate the Compound Interest


View Solution


Program [50]

write a program to find sale price of an item with given price and discount (%)


View Solution


Program [51]

write a program to calculate the sum of odd numbers divisible by 5 from the range 1..100


View Solution


Program [52]

Write a Python program to accept 3 sides of triangle and find the area of triangle.

s = (a+b+c)/2

area = √(s(s-a)*(s-b)*(s-c))


View Solution


Program [53]

Write a python program which accept two times as input and displays the total time after adding both the entered times.

Sample Input :

Enter Time 1 :

Hour : 3

Minute : 40

Enter Time 2 :

Hour : 2

Minute : 35


Output:


Time 1 : 3  Hour & 40  Minute

Time 2 : 2  Hour & 35  Minute

Total Time  : 6  Hour & 15  Minute




View Solution


Program [54]

Write a python program which accept two times (HH:MM:SS) as input and displays the total time after adding both the entered times.

Sample :

Input:

Enter Time 1 :

Hour : 2

Minute : 40

Second : 45

Enter Time 2 :

Hour : 1

Minute : 35

Second : 40

Output:

Time 1 : 2  Hour, 40  Minute and  45  Second

Time 2 : 1  Hour, 35  Minute and  40  Second

Total Time  : 4  Hour & 16  Minute and  25 Second



View Solution


Program [55]

write a program to print one of the words negative, zero or positive, according to whether variable x is less than zero, zero, or greater than zero, respectively.


View Solution


Program [56]

Write a program that returns True if the input number is an even number, False otherwise.


View Solution


Program [57]

Write a python program to input cost price, selling price of product from user and check whether is profit or loss and also print the Profit/loss amount


View Solution


Program [58]

Write a python program to input a number form user and check whether number is buzz number or not.

A number is said to be Buzz Number if it ends with 7 or is divisible by 7.


View Solution


Program [59]

Write a program to input assets, liabilities and capital of a company and test if accounting equation holds true for the given value (i.e., balanced or not).

Hint : assets == liabilities + capital 



View Solution


Program [60]

Write a program to input total debt and total assets and calculate total-debt-to-total-assets ratio (TD/TA) as Total Debt/Total Assets. Then print if the major portion of the debt is funded by assets (when TD/TA > 1) or greater portion of assets is funded by equity (when TD/TA < 1).


View Solution


Program [61]

Write a program to calculate Debt-to-equity (D/E) ratio as [ Total Liabilities  / Total shareholders' ] equity after inputting total liabilities and total shareholders' equity. And then print if an investor should invest in the company or not. A D/E ratio greater than 2.0 indicates a risky scenario for an investor.


View Solution


Program [62]

Write a python program to accept an integer number to find out and print the difference between greatest and smallest digits presents in the number .



View Solution


Program [63]

Write a python program to accept an integer number and print the frequency of each digit present in the number .

Sample:

Input : 3255435

Output: 

Digit Frequency

2 1

3 2

4 1

5 3


View Solution


Program [64]

Write a program to print Floyd's triangle as shown below:

1

2  3

4  5  6

7  8  9  10

11 12 13 14 15


View Solution


Program [65]

Write a program to input any number and to check whether given number is Armstrong or not.

Example:

Armstrong 153,

1^3+5^3 +3^3 =(1+125+27)=153


View Solution


Program [66]

 Write a program to find all prime numbers up to given number


View Solution


Program [67]

Write a program to convert decimal number to binary.


View Solution


Program [68]

Write a program to convert binary to decimal.


View Solution


Program [69]

Program to print quotient.



View Solution


Program [70]

Write a program to obtain principal amount, rate of interest and time from user and compute simple interest.


View Solution


Program [71]

Program to calculate area and perimeter of a parallelogram


View Solution


Program [72]

 Program demonstrating working with power operator


View Solution


Program [73]

Program of division operator(/)


View Solution


Program [74]

Program of modulus


View Solution


Program [75]

Program convert dollars in Rupee 

View Solution


Program [76]

Program to convert kilometers to miles 


View Solution


Program [77]

Program to calculate GST

View Solution


Program [78]

Credit Card Program


View Solution


Program [79]

Program to print absolute value of number provided by the user.


View Solution


Program [80]

Program to check divisibility of a number 


View Solution


Program [81]

Program to print the largest number 


View Solution


Program [82]

Program to display menu to calculate are of square or rectangle 


View Solution


Program [83]

Write a python program to print larger number using swap


View Solution


Program [84]

Write Python program to calculate Electricity Bill


View Solution


Program [85]

Write Python program to input three number and print in ascending order


View Solution


Program [86]

Write a Python program to  check character is alphabetic character or not


View Solution


Program [87]

Write Python program to print letters of entered word


View Solution


Program [88]

Write a Python program to print ASCII code for entered message


View Solution


Program [89]

Write Python program to print first ten mersenne numbers. Numbers in the form 2n-1 are called Mersenne numbers.

For example, the first Mersenne number is 21-1=1, the second Mersenne number is 22-1=3 etc.





View Solution


Program [90]

Write a program to obtain x, y, z from user and calculate expression : 4x4 + 3y3 + 9z + 6π


View Solution


Program [91]

Write a program that reads a number of seconds and prints it in form : mins and seconds, e.g., 200 seconds are printed as 3 mins and 20 seconds.

[Hint. use // and % to get minutes and seconds]


View Solution


Program [92]

Write a program to take year as input and check if it is a leap year or not.


View Solution


Program [93]

Write a program to take two numbers and print if the first number is fully divisible by second number or not.


View Solution


Program [94]

Write a program to take a 2-digit number and then print the reversed number. That is, if the input given is 25, the program should print 52.


Solution


View Solution


Program [95]

Write a program to take a 3-digit number and then print the reversed number. That is, if you input 123, the program should print 321.


View Solution


Program [96]

Write a program to take two inputs for day, month and then calculate which day of the year, the given date is. For simplicity, take 30 days for all months. For example, if you give input as: Day3, Month2 then it should print "Day of the year : 33".


View Solution


Program [97]

Write a program that asks a user for a number of years, and then prints out the number of days, hours, minutes, and seconds in that number of years.


How many years? 10

10.0 years is:

3650.0 days

87600.0 hours

5256000.0 minutes

315360000.0 seconds


View Solution


Program [98]

Write a program that inputs an age and print age after 10 years as shown below:


What is your age? 17

In ten years, you will be 27 years old!


View Solution


Program [99]

Write a program that generates six random numbers in a sequence created with (start, stop, step). Then print the mean, median and mode of the generated numbers.


View Solution


Program [100]

Write a program to generate 3 random integers between 100 and 999 which is divisible by 5.


View Solution


Program [101]

Write a program to generate 6 digit random secure OTP between 100000 to 999999.


View Solution


Program [102]

Write a program to generate 6 random numbers and then print their mean, median and mode


View Solution


Program [103]

Write a program to find a side of a right angled triangle whose two sides and an angle is given.


View Solution


Program [104]

Write a program to calculate the radius of a sphere whose area (4πr2) is given.


View Solution


Program [105]

Write a program to calculate the area of an equilateral triangle. (area = (√3 / 4) * side * side).


View Solution


Program [106]

Write a program to input the radius of a sphere and calculate its volume (V = 4/3πr3)


View Solution


Program [107]

Write a program to calculate amount payable after simple interest.


View Solution


Program [108]

Write a program to input length of three sides of a triangle. Then check if these sides will form a triangle or not.

(Rule is: a+b>c;b+c>a;c+a>b)


View Solution


Program [109]

Write a program to input 3 sides of a triangle and print whether it is an equilateral, scalene or isosceles triangle.


View Solution


Program [110]

Write a program to take N (N > 20) as an input from the user. Print numbers from 11 to N. When the number is a multiple of 3, print "Tipsy", when it is a multiple of 7, print "Topsy". When it is a multiple of both, print "TipsyTopsy".


View Solution


Program [111]

Write a program to input N numbers and then print the second largest number.


View Solution


Program [112]

Given a list of integers, write a program to find those which are palindromes. For example, the number 4321234 is a palindrome as it reads the same from left to right and from right to left.


View Solution


Program [113]

Write a complete Python program to do the following :


(i) read an integer X.


(ii) determine the number of digits n in X.


(iii) form an integer Y that has the number of digits n at ten's place and the most significant digit of X at one's place.


(iv) Output Y.


(For example, if X is equal to 2134, then Y should be 42 as there are 4 digits and the most significant number is 2).


View Solution


Program [114]

Write a Python program to print every integer between 1 and n divisible by m. Also report whether the number that is divisible by m is even or odd.


View Solution


Program [115]

Write a Python program to input 2 numbers and fin the LCM.


View Solution


Program [116]

Write a Python program to input two number and find the G.C.D


View Solution


Program [117]

Write a program to input any Character and find its ASCII Value.


View Solution


CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad