Last active
September 19, 2015 11:54
-
-
Save njadhav1/da3e07c7917087c87199 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
numbers=raw_input("Enter three values by space seprate : ") | |
number_in_list=numbers.split() | |
print number_in_list | |
print(type(number_in_list[0])) | |
3 | |
if (number_in_list[0] > number_in_list[1]) and (number_in_list[0] > number_in_list[2]): | |
print "large number is {}".format(number_in_list[0]) | |
elif (number_in_list[1] > number_in_list[2]) and (number_in_list[1] > number_in_list[0]): | |
print "large number is {}".format(number_in_list[1]) | |
elif (number_in_list[2] > number_in_list[1]) and (number_in_list[2] > number_in_list[0]): | |
print "large number is {}".format(number_in_list[2]) | |
else: | |
print "all number equal {}".format(number_in_list[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# number claulcation via while loop | |
import sys | |
userstatus=raw_input("you want to check for largest number (Y/N) : ") | |
while True: | |
if userstatus == "N": | |
sys.exit(0) | |
elif userstatus == "Y" : | |
num1=input("Print number 1 : ") | |
num2=input("Print number 2 : ") | |
num3=input("Print number 3 : ") | |
if(num1 > num2 and num1 > num3): | |
print "Number 1 is greter : {}".format(num1) | |
elif(num2 > num3 and num2 > num1): | |
print "Number 2 is grater: {}".format(num2) | |
elif(num3 > num1 and num3 > num2): | |
print "Number 3 is grate : {}".format(num3) | |
else: | |
print "All Threee number are equal: {}".format(num1) | |
else: | |
print "INVALID INPUT Try Again" | |
userstatus=raw_input("want to continue number (Y/N) : ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment