def main(): # Utworzenie trzech egzemplarz klasy Coin. coin1 = coin.Coin() coin2 = coin.Coin() coin3 = coin.Coin() # Wyświetlenie wyników rzutów monetami. print('Oto wyniki rzutów trzema monetami:') print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup()) print() # Symulacja rzutu monetą. print('Symulacja rzutów trzema monetami...') print() coin1.toss() coin2.toss() coin3.toss() # Wyświetlenie wyników rzutów monetami. print('Oto wyniki rzutów trzema monetami:') print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup()) print()
def main(): # create three objects from the Coin class coin1 = coin.Coin() coin2 = coin.Coin() coin3 = coin.Coin() # Display the side of each coin that is facing up print('I have three coins with these sides up:') print('coin1:', coin1.get_sideup()) print('coin2:', coin2.get_sideup()) print('coin3:', coin3.get_sideup()) # Toss the coin print('I am tossing all three coins..') print() coin1.toss() coin2.toss() coin3.toss() # Display the side of each coin that is now facing up print('I have three coins with these sides up:') print('coin1:', coin1.get_sideup()) print('coin2:', coin2.get_sideup()) print('coin3:', coin3.get_sideup()) print()
def main(): # create three objects from the Coin class. coin1 = coin.Coin() coin2 = coin.Coin() coin3 = coin.Coin() # display the side of each coin that is facing up print("I have three coins with these sides up: ") print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup()) print() # toss the coin. print("I am tossing all three coins. . .") print() coin1.toss() coin2.toss() coin3.toss() # display the side of each coin that is facing up print("Now here are the sides that are up:") print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup()) print()
def main(): # Create three objects from the Coin class. coin1 = coin.Coin() coin2 = coin.Coin() coin3 = coin.Coin() # Display the side of each coin that is facing up. print('I have three coins with these sides up:') print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup()) print("testVar - coin1 = ", coin1.testVar) print("testVar - coin2 = ", coin2.testVar) print("testVar - coin3 = ", coin3.testVar) coin.Coin.testVar += 1 print("testVar - coin1 = ", coin1.testVar) print("testVar - coin2 = ", coin2.testVar) print("testVar - coin3 = ", coin3.testVar) # Toss the coin. print('I am tossing all three coins...') print() coin1.toss() coin2.toss() coin3.toss() # Display the side of each coin that is facing up. print('Now here are the sides that are up:') print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup())
def main(): # Создать три объекта класса Coin. coin1 = coin.Coin() coin2 = coin.Coin() coin3 = coin.Coin() # Показать повернутую вверх сторону каждой монеты. print('Вот три монеты, у которых стороны обращены вверх:') print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup()) print() # Подбросить монету. print('Подбрасываю все три монеты...') print() coin1.toss() coin2.toss() coin3.toss() # Показать повернутую вверх сторону каждой монеты. print('Теперь обращены вверх вот эти стороны:') print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup()) print()
def main(): # Create three objects from the Coin class. Coin = 5 a = coin.Coin() b = coin.Coin() c = coin.Coin() testDel(a, b, c)
def instantiatecoins(coindata): global coins # This is going to be the bigliest dict of coin objects ever. I'm in there too! icoins = 0 window.txtdebug.insert(tk.END, "Creating Coin Objects ...\r\n") for item in coindata: status = item.get("Status") name = item.get("Name") algorithm = item.get("Algorithm") maxwithdraw = item.get("MaxWithdraw") minwithdraw = item.get("MinWithdraw") symbol = item.get("Symbol") coinid = item.get("Id") depositconfirmations = item.get("DepositConfirmations") minbasetrade = item.get("MinBaseTrade") mintip = item.get("MinTip") tipenabled = item.get("IsTipEnabled") listingstatus = item.get("ListingStatus") withdrawfee = item.get("WithdrawFee") statusmsg = item.get("StatusMessage") # Instantiate a coin newcoinobj = coin.Coin(status, name, algorithm, maxwithdraw, minwithdraw, symbol, coinid, depositconfirmations, minbasetrade, mintip, tipenabled, listingstatus, withdrawfee, statusmsg) # Put it in a dict coins[symbol] = newcoinobj window.lstcoins.insert(tk.END, symbol) icoins = icoins + 1 window.txtdebug.insert(tk.END, str(icoins) + " Coins Instantiated\r\n") window.txtdebug.see(tk.END)
def main(): mycoin1 = coin.Coin() print("the side is up:", mycoin1.get_toss()) for count in range(10): mycoin1.toss() print(mycoin1.get_toss())
def main(): my_coin = coin.Coin() print('This side is up:', my_coin.get_sideup()) print("I am going to toss the coin ten times") for count in range(10): my_coin.toss() print(my_coin.get_sideup())
def test_coin_object_basic_initialization(coin_name, coin_sym): coin_obj = mycoin.Coin(coin_name, coin_sym) assert isinstance(coin_obj, mycoin.Coin) assert coin_obj.circulating == 0 assert coin_obj.price == 0 assert coin_obj.mineable == False assert coin_obj.fixed_supply == False assert coin_obj.mineable == False
def main(): my_coin = coin.Coin() print(my_coin.get_sideup()) flip(my_coin) print(my_coin.get_sideup())
def main(): my_coin = coin.Coin() print('Side facing up:', my_coin.get_sideup()) # Toss the coin print('I am going to toss the coin ten times:') for toss in range(10): my_coin.toss() print('Toss', toss + 1, my_coin.get_sideup())
def main(): my_coin = coin.Coin() print('This side up is ', my_coin.get_sideup()) #toss the coin print('I am tossing the coin tens times...') for count in range(10): my_coin.toss() print('This side up is ', my_coin.get_sideup())
def main(): coin1 = coin.Coin() print(coin1.getsideup()) coin1.toss() print(coin1.getsideup()) print(coin1) str(coin1)
def main(): count = 0 my_coin = coin.Coin() while my_coin.is_heads(): print(my_coin.get_sideup()) count += 1 my_coin.toss() print(my_coin.get_sideup()) print('The count was %d' % count)
def main(): # Create an object from the Coin class. my_coin = coin.Coin() # Display the side of the coin that is facing up. print('This side is up:', my_coin.get_sideup()) # Toss the coin. # Toss the coin. print('I am going to toss the coin ten times:') for count in range(10): my_coin.toss() print(my_coin.get_sideup())
def __init__(self): """ Constructor for the ZeroPlatform class """ super(ZeroPlatform, self).__init__() # Randomly add coins on this platform for i in range(0, constants.SCREEN_WIDTH, 68): random_num = random.randint(0, 100) if random_num % 2 == 0: gold_coin = coin.Coin() gold_coin.rect.left = i + 5 gold_coin.rect.bottom = constants.SCREEN_HEIGHT self.coins_list.add(gold_coin) Platform.all_coins.add(gold_coin)
def main(): #create an object from Coin class my_coin = coin.Coin() # Display the side of the coin that is facing up print("This side is up", my_coin.get_sideup()) #toss coin print("I am tossing the coin 10 times:") for count in range(10): my_coin.toss() print(my_coin.get_sideup())
def main(): # create an object from the Coin class. my_coin=coin.Coin() # display the side of the coin that is facing up. print("This side is up:", my_coin.get_sideup()) # toss the coin. print("I am going to toss the coin ten times:") for count in range(10): my_coin.toss() print(my_coin.get_sideup())
def main(): #create a coin object my_coin = coin.Coin() # This wil display "Heads" print(my_coin.get_sideup()) # Pass the object to flip function flip(my_coin) #This might display Heads or Tails print(my_coin.get_sideup())
def main(): # Создать объект на основе класса Coin. my_coin = coin.Coin() # Показать обращенную вверх сторону монеты. print('Эта сторона обращена вверх:', my_coin.get_sideup()) # Подбросить монету. print('Собираюсь подбросить монету десять раз:') for count in range(10): my_coin.toss() print(my_coin.get_sideup())
def main(): # create a coin object my_coin = coin.Coin() # This might display 'Heads' or 'Tails' print(my_coin.get_sideup()) # This will display 'Heads' flip(my_coin) # This might display 'Heads' or 'Tails' print(my_coin.get_sideup())
def main(): # create a Coin object my_coin = coin.Coin() # This will display 'Heads' print(my_coin.get_sideup()) # pass the object to the flip function flip(my_coin) # this maight display 'Heads' or 'Tails' print(my_coin.get_sideup())
def main(): # Utworzenie obiektu na podstawie klasy Coin. my_coin = coin.Coin() # Wyświetlenie wyniku rzutu monetą. print('Wynik rzutu monetą:', my_coin.get_sideup()) # Symulacja rzutu monetą. print('Symulacja dziesięciu rzutów monetą:') for count in range(10): my_coin.toss() print(my_coin.get_sideup())
def main(): # Create a Coin object my_coin = coin.Coin() # This will display 'Heads' print(my_coin.get_sideup()) # Pass the object to the flip function. flip(my_coin) # This might display 'Heads', or it might # display 'Tails'. print(my_coin.get_sideup())
def main(): # create a Coin object (an instance of it) my_coin = coin.Coin() # this will display "Heads" print(my_coin.get_sideup()) # pass the object to the flip function flip(my_coin) # this might display "Heads", or it might # display "Tails". print(my_coin.get_sideup())
def test_coin_collision(define_sprites): #Set players initial position define_sprites.rect.left = 100; define_sprites.rect.bottom = 0; #Set a coin at p0layers position gold_coin = coin.Coin() gold_coin.rect.left = define_sprites.rect.left gold_coin.rect.bottom = define_sprites.rect.bottom landforms.Platform.all_coins.add(gold_coin) #Check coin collection define_sprites.collect_coin() assert len(landforms.Platform.all_coins) == 0 assert define_sprites.score == 5
def main(): coin1 = coin.Coin() print(coin1.get_sideup()) flip(coin1) print(coin1.get_sideup()) coin_status = str(coin1) print(coin_status)
def main(): # Utworzenie obiektu Coin. my_coin = coin.Coin() # To polecenie wyświetli ciąg tekstowy 'orzeł'. print(my_coin.get_sideup()) # Przekazanie obiektu funkcji flip(). flip(my_coin) # To polecenie może wyświetlić ciąg tekstowy # 'orzeł' lub 'reszka'. print(my_coin.get_sideup())
def main(): coin1 = coin.Coin() coin2 = coin.Coin() coin3 = coin.Coin() print('I have three coins with these sides up:') print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup()) print() print('I am tossing all three coins...') coin1.toss() coin2.toss() coin3.toss() print() print('Now here are the sides that are up:') print(coin1.get_sideup()) print(coin2.get_sideup()) print(coin3.get_sideup()) print()