1709846253

Find the smallest number among three numbers in python


This is the Python program to find the smallest among three numbers. ```py # Python program to find the smallest among three numbers # taking input from user num1 = int(input("Enter 1st number: ")) num2 = int(input("Enter 2nd number: ")) num3 = int(input("Enter 3rd number: ")) if(num1 <= num2) and (num1 <= num3): snum = num1 elif(num2 <= num1) and (num2 <= num3): snum = num2 else: sum = num3 print("the smallest number among",num1,",",num2,"and",num3,"is: ",snum) ``` We are taking input from the user. The user will enter first number with the help of prompt. Then second number, you see her. Then number two is into input. And two, second number. Then the third number. Then we will check with the help of condition, that which number is smaller. We will check that if no one is smaller than equal to number two and number one is smaller than equal to number three, then smaller number is equal to number one ELIF. Number two is similar than equal to number one and number two is smaller than equal to number three. Then smaller number is equal to number two. So we have checked first number here then, Jack. Second number here. So we don't need to check the third number. We will just simply include this with the help of ls that smaller number. Is it equal to number three? So this brief statement will. But it there is some our last number. Among the three numbers is the number one, two and three. i'm going to bring more than 40 ready-made python solutions here. but to give you a boost i'd appreciate it if you could leave a comment here on can or share this content with more people. thanks😉

(0) Comments

Welcome to Chat-to.dev, a space for both novice and experienced programmers to chat about programming and share code in their posts.

About | Privacy | Terms | Donate
[2024 © Chat-to.dev]