fork download
  1. #zmienne
  2. zmienna = 56
  3.  
  4. print("dzisiaj jest środa")
  5. print("38 + 23 = ", end='')
  6. print(38 + 23)
  7. print(zmienna)
  8.  
  9. #funkcje
  10. def pole_prostokąta(bok1, bok2):
  11. return bok1 * bok2
  12. print("P = ", pole_prostokąta(124, 93))
  13.  
  14. #instrukcja warunkowa
  15. #prosta
  16. x = 0
  17. if x % 3 == 0: #x % 3 - reszta z dzielenia liczby x przez 3
  18. print("liczba", x, "jest podzielna przez 3")
  19.  
  20. #złożona
  21. if x > 0:
  22. print("liczba", x, "jest dodatnia")
  23. elif x == 0:
  24. print("liczba", x, "jest równa 0")
  25. else:
  26. print("liczba", x, "jest ujemna")
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
Success #stdin #stdout 0.07s 14196KB
stdin
Standard input is empty
stdout
dzisiaj jest środa
38 + 23 = 61
56
P =  11532
liczba 0 jest podzielna przez 3
liczba 0 jest równa 0