fork download
  1. def ile_kolorowych(n,kolor):
  2. if kolor=="b":
  3. return n*n//2
  4. else:
  5. return (n*-1)//2+1
  6. print(ile_kolorowych(8, "b"))
  7. print(ile_kolorowych(8, "c"))
  8. print(ile_kolorowych(7, "b"))
  9. print(ile_kolorowych(7, "c"))
Success #stdin #stdout 0.08s 14164KB
stdin
Standard input is empty
stdout
32
-3
24
-3