Facebook
From ManfredMacx, 5 Years ago, written in Python.
This paste is a reply to rzut_moneta from bumelante - go back
Embed
Viewing differences between rzut_moneta and Re: rzut_moneta
# rzut moneta
# generuje 100 rzutow moneta i podaje liczbe orzelkow i reszek

import random

orzel = 0
reszka = 0
suma = 0

while suma < 100:
    rzut = random.randint(1,2)
    suma += 1

  if rzut == 1:
    
1:
      
orzel += 1
    

1
      
  
  
if rzut == 2:
    
2:
      
reszka += 1
    

print ("rzuciles moneta", suma, "razy")   
print ("\norzel wypadl", orzel, "razy, a reszka", reszka, "razy")

input("\n\nPress the enter key to exit.")