SHARE
TWEET

Untitled

a guest Jun 18th, 2019 71 in 8 hours
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def intcompare(a,b):
  2.     if int(a) >= int(b):
  3.         return(a)
  4.     else:
  5.         return(b)
  6.  
  7. def charcompare(a,b):
  8.     if ord(a) >= ord(b):
  9.         return(a)
  10.     else:
  11.         return(b)
  12.  
  13. def stringcompare(string1,string2):
  14.     if id(string1) >= id(string2) and len(string2) >= len(string1):
  15.         return(string1)
  16.     else:
  17.         return(string2)
  18.  
  19.  
  20. type = input()
  21. x = input()
  22. y = input()
  23.  
  24.  
  25. if type == "int":
  26.     print(intcompare(int(x),int(y)))
  27. elif type == "char":
  28.     print(charcompare(x,y))
  29. elif type == "string":
  30.     print(stringcompare(x,y))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top