Python Program to Print All Integers that Aren’t Divisible by Either 2 or 3

This is a Python Program to print all integers that aren’t divisible by either 2 or 3 and lies between 1 and 50. Problem Description The program prints all integers that aren’t divisible by either 2 or 3 and lies between 1 and 50. Problem Solution 1. Use a for-loop ranging from 0 to 51. … Read more

advertisement

Python Program to Find the Smallest Divisor of an Integer

This is a Python Program to find the smallest divisor of an integer. Problem Description The program takes in an integer and prints the smallest divisor of the integer. Problem Solution 1. Take in an integer from the user. 2. Use a for loop where the value of i ranges from 2 to the integer. … Read more

advertisement

Python Program to Print Sum of Negative Numbers, Positive Even Numbers and Positive Odd numbers in a List

This is a Python Program to print the sum of negative numbers, positive even numbers and positive odd numbers in a given list. Problem Description The program prints the sum of negative numbers, positive even numbers and positive odd numbers in a given list.. Problem Solution 1. Take in the number of elements to be … Read more

advertisement

Python Program to Convert Centimeters to Feet and Inches

This is a Python Program to read height in centimeters and then convert the height to feet and inches Problem Description The program reads the height in centimeters and then converts the height to feet and inches. Problem Solution 1. Take the height in centimeters and store it in a variable. 2. Convert the height … Read more

advertisement

Python Program to Convert Celsius to Fahrenheit

Problem Description Write a Python program that takes the temperature in Celsius and converts it to Fahrenheit. What is Celsius? Celsius is a unit used to measure temperature on the Celsius scale. It is named after the Swedish astronomer Anders Celsius and is commonly represented by the symbol °C(degree Celsius). What is Celsius scale? The … Read more

advertisement

Python Program to Find Simple Interest

Problem Description Write a Python program that calculates simple interest based on the principal amount, interest rate, and time period provided. What is Simple Interest? Simple Interest is a basic financial concept used to calculate the interest earned or paid on a principal amount over a certain period of time, based on a fixed interest … Read more

advertisement

Python Program to Check Leap Year

Problem Description Write a Python program that takes a year as input and checks whether it is a leap year or not. What is Leap Year? A leap year is a year that is divisible by 4 but not by 100, unless it is also divisible by 400. Leap years have an extra day, February … Read more

advertisement

Python Program to Find Average of a List

This is a Python Program to Calculate the Average of Numbers in a Given List. Problem Description The program takes the elements of the list one by one and displays the average of the elements of the list. Problem Solution 1. Take the number of elements to be stored in the list as input. 2. … Read more

advertisement

Python Program to Check if a Date is Valid and Print the Incremented Date if it is

This is a Python Program to check if a date is valid and print the incremented date if it is. Problem Description The program takes in a date and checks if it a valid date and prints the incremented date if it is. Problem Solution 1. Take in the date of the form: dd/mm/yyyy. 2. … Read more

advertisement

Sum of Digits Program in Python

This is a Python Program to find the sum of digits in a number. Problem Description The program takes in a number and finds the sum of digits in a number. Problem Solution 1. Take the value of the integer and store in a variable. 2. Using a while loop, get each digit of the … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.