How to code using python so it can tell me the mode without using input or print and using def, if and ele -


my code far, error testing it:

# without using collection data types list or set, # function determines value appears , returns it.  def mode3(a, b, c):      # starting value variable ans. replace     # actual answer before reaching return stmt.if int(value) < 0 :       ans = none if int(mode3(a, a, b)):     ans = "a" if int(mode3(a, b, b)):     ans = "b" if int(mode3(a, c, c)):     ans = "c" else:     return ans 

original screenshot

i think looking is

def mode3(a, b, c):     if == b or == c:         return     elif b == c:         return b     else:         return none 

and can test like

mode3(1, 1, 1)     # => 1 mode3(1, 1, 2)     # => 1 mode3(1, 2, 1)     # => 1 mode3(2, 1, 1)     # => 1 mode3(1, 2, 3)     # => none 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -