def kam(a): if (a[0] != "A"): return "Kamarát" return "nie" def kam2(a): if (a[0] == "A") or (a[0] == "B"): return "Kamarát" return "nie" print kam("Adam") print kam("Milan") print kam("Bára") def vyssi(a,b): if (a > b): return a return b def nejvyssi(a,b,c): return vyssi(vyssi(a,b),c) def median(a,b,c): nej = nejvyssi(a,b,c) if (nej == a): return vyssi(b,c) if (nej == b): return vyssi(a,c) return vyssi(b,a) # print nejvyssi(5,7,8) # print median(9,9,9) # print vyssi(6,7) def vstup(vek): if (vek <= 18) or (vek >= 65): return 50 return 100 # print vstup(65) def jmeno(jm): if (jm == "James Bond"): return "007" elif (len(jm) > 15): return "too long" pri = jm[jm.find(" ")+1:] me = jm[:jm.find(" ")] return pri+" "+me # print jmeno("James Bond") # print jmeno("lk jjl") # print jmeno("Michal Adamovickljll") #jm = "Peter Ondrejka" # str # pri = jm[jm.find(" ")+1:] # me = jm[:jm.find(" ")] #print pri+" "+me # jm = "Peter Ondrejka" # str # a = 100 # int # b = 3. # float # print jm[:6] # print jm.find("e", 6) # print "citat: \"ahoj\"" # print "Hello"+" "+jm # print int(a)/ float(b)