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

Python Program to Swap Two Numbers without using Third Variable

This is a Python Program to exchange the values of two numbers without using a temporary variable. Problem Description The program takes both the values from the user and swaps them without using temporary variable. Problem Solution 1. Take the values of both the elements from the user. 2. Store the values in separate variables. … Read more

advertisement

Python Program to Reverse a Number

Problem Description Write a Python Program to reverse a given number. Problem Solution Reversing a number means changing the order of its digits. For example, if we reverse the number 124, we get 421. It involves rearranging the digits of the given number from right to left. There are several ways to reverse a number … Read more

advertisement

Python Program to Check Whether a Number is Positive or Negative

This is a Python Program to check whether a number is positive or negative. Problem Description The program takes a number and checks whether it is positive or negative. Problem Solution 1. Take the value of the integer and store in a variable. 2. Use an if statement to determine whether the number is positive … Read more

advertisement

Python Program to Find Quotient and Remainder of Two Numbers

This is a Python Program to read two numbers and print their quotient and remainder. Problem Description The program takes two numbers and prints the quotient and remainder. Problem Solution 1. Take in the first and second number and store it in separate variables. 2. Then obtain the quotient using division and the remainder using … Read more

advertisement

Python Program to Print All Odd Numbers in a Range

This is a Python Program to print odd numbers within a given range. Problem Description The program takes the upper and lower limit and prints all odd numbers within a given range. Problem Solution 1. Take in the upper range limit and the lower range limit and store it in separate variables. 2. Use a … Read more

advertisement

Python Program to Read a Number n and Compute n+nn+nnn

This is a Python Program to read a number n and compute n+nn+nnn. Problem Description The program takes a number n and computes n+nn+nnn. Problem Solution 1. Take the value of a element and store in a variable n. 2. Convert the integer into string and store it in another variable. 3. Add the string … Read more

advertisement

Python Program to Print All Numbers in a Range Divisible by a Given Number

This is a Python Program to print all numbers in a range divisible by a given number. Problem Description The program prints all numbers in a range divisible by a given number. Problem Solution 1. Take in the upper range and lower range limit from the user. 2. Take in the number to be divided … Read more

advertisement

Python Program to Check Whether a Given Number is Perfect Number

This is a Python Program to check if a number is a Perfect number. Problem Description The program takes a number and checks if it is a Perfect number. Problem Solution 1. Take in an integer and store it in a variable. 2. Initialize a variable to count the sum of the proper divisors to … 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.