SHARE
TWEET

Untitled

a guest Feb 14th, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ciselna_promenna = 3
  2. textova_promenna = "Ahoj"
  3. seznam_promenna = [1, 3]
  4. senzam_range = range(1, 16) # =[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
  5. seznam_promenna2 = ["Jedna", "dva"]
  6. seznam_seznamu = [[1,2,3], [15,16,17]]
  7.  
  8. nova_hodnota = ciselna_promenna * 10
  9. print(nova_hodnota)
  10.  
  11. text2 = textova_promenna + " svete"
  12. print(text2)
  13.  
  14. dictionary = {
  15.   "Jan": 36,
  16.   "Karel": 28,
  17.   "Jana": 18,
  18.   "Pepa": 8
  19. }
  20.  
  21. print(dictionary["Jan"])
  22.  
  23. lidi = {
  24.   "Jan": {
  25.     "vek": 36,
  26.     "vyska": 176,
  27.     "miry": [90, 95, 98]
  28.   },
  29.   "Karel": {
  30.     "vek": 28,
  31.     "vyska": 190,
  32.     "miry": [134, 23, 45]
  33.   }
  34. }
  35. lidi = {}
  36. lidi["Jan"] = {}
  37. lidi["Jan"]["vek"] = 36
  38. lidi["Karel"]["miry"] = [134, 23, 45]
  39.  
  40. print(lidi["Jan"]["miry"][0])
  41. #===============
  42.  
  43. ciselna_promenna = 3
  44. textova_promenna = "Ahoj"
  45. seznam_promenna = [1, 3]
  46. senzam_range = range(1, 16) # =[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
  47. seznam_promenna2 = ["Jedna", "dva"]
  48. seznam_seznamu = [[1,2,3], [15,16,17]]
  49.  
  50. nova_hodnota = ciselna_promenna * 10
  51. print(nova_hodnota)
  52.  
  53. text2 = textova_promenna + " svete"
  54. print(text2)
  55.  
  56. dictionary = {
  57.   "Jan": 36,
  58.   "Karel": 28,
  59.   "Jana": 18,
  60.   "Pepa": 8
  61. }
  62.  
  63. print(dictionary["Jan"])
  64.  
  65. lidi = {
  66.   "Jan": {
  67.     "vek": 36,
  68.     "vyska": 176,
  69.     "miry": [90, 95, 98]
  70.   },
  71.   "Karel": {
  72.     "vek": 28,
  73.     "vyska": 190
  74.   }
  75. }
  76. for jmeno in lidi:
  77.   print(lidi[jmeno]["vek"])
  78.  
  79.  
  80. for nove_jmeno in seznam_promenna2:
  81.   print(nove_jmeno)
  82.  
  83.  
  84.  
  85. #===============
  86.  
  87.  
  88. def cerna_krabicka(a, b):
  89.   soucet = a + b
  90.   return soucet
  91.  
  92. def cerna_krabicka2(a, b, c):
  93.   soucet1 = cerna_krabicka(a, b)    # soucet1 = a + b
  94.   soucet = cerna_krabicka(soucet1, c) # soucet = soucet1 + c = a + b + c
  95.   return soucet
  96.  
  97.  
  98. vysledek = cerna_krabicka2(10, 20, 30)
  99.  
  100. print(vysledek)
  101.  
  102.  
  103. # =================
  104.  
  105. def mocniny(zacatek, konec):
  106.   vysledek = {}
  107.   for cislo in range(zacatek, konec): # [zacatek, zacatek+1, ..., konec-1]
  108.     vysledek[cislo] = cislo * cislo
  109.   return vysledek
  110.  
  111. # mocniny(1,4)
  112. # vysledek = {}
  113. # ..for range(1,4) = [1,2,3]
  114. # - cislo = 1
  115. #.  vysledek[1] = 1*1
  116. #.- cislo = 2
  117. #.  vysledek[2] = 2*2
  118. # - cislo = 3
  119. #.  vysledek[3] = 3*3  
  120.  
  121. # {
  122. #.  1: 1
  123. #.  2: 4
  124. #.  3: 9
  125. # }
  126.  
  127. hodnoty = mocniny(1, 4)
  128. print(hodnoty)
  129. print(hodnoty.values())
  130.  
  131. for m in hodnoty.values():
  132.   print(m)
  133.  
  134. #ceny = {}
  135. #for radek in range(0, 101):
  136. #  polozka = excel.bunka(1, radek)
  137. #  cena = excel.bunka(2, radek)
  138. #  ceny[polozka] = cena
  139.  
  140. #celkova_cena = 0
  141. #for cena_2 in ceny.values():
  142. #  celkova_cena = celkova_cena + cena_2
  143.  
  144.  
  145. # ======================
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
Top