Part One - https://youtu.be/nroU9zOQF3c Part Two - https://youtu.be/R4rKdN9NCrk Part Three - https://youtu.be/m4JMDuxz030 Part Four - https://youtu.be/AhXY0eYhTTM Part Five - https://youtu.be/Wse90U2Pzkc In this tutorial, we continue to build our street craps this is part 2 you can find part 1 here https://youtu.be/nroU9zOQF3c. Make sure you watch the first Python tutorial. In this Python By Example tutorial we will add some inputs and an if statement. This is some sloppy coding but this is intentional to help everyone learn. At the bottom of this description you can find our code. Be sure to like, share and comment to show your support for our tutorials. ======================================= Channel - https://goo.gl/pnKLqE Playlist for Python Q & A = https://goo.gl/EyZFti Latest Video - https://goo.gl/atWRkF Facebook - https://www.facebook.com/Master-Code-... Twitter - https://twitter.com/mastercodeonlin?l... Website - http://mastercode.online ====================================== from random import randint def dice_roll(): dice_1 = randint(1, 6) dice_2 = randint(1, 6) return dice_1, dice_2 shooters_bet = input("The amount you would like to bet? ") number_of_players = input("Total number of players? ") first_move = input('Shoot or change bet? Enter either shoot or change: ') if first_move == 'shoot': roll = dice_roll() print("Dice 1 rolled a {}".format(roll[0])) print("Dice 2 rolled a {}".format(roll[1])) print(sum(roll)) else: shooters_bet = input("The amount you would like to bet? ") first_move = input('Shoot or change bet? Enter either shoot or change: ') if first_move == 'shoot': roll = dice_roll() print("Dice 1 rolled a {}".format(roll[0])) print("Dice 2 rolled a {}".format(roll[1])) print(sum(roll))
Python By Example: Street Craps - Part 2 - YouTube | |
8 Likes | 8 Dislikes |
360 views views | 14,790 followers |
Education | Upload TimePublished on 8 Oct 2017 |
Không có nhận xét nào:
Đăng nhận xét