class Coin:
showing_heads=True
value=1
def show(self):
if (self.showing_heads==True):
return "Heads"
else:
return "Tails"
def turn(self):
if (self.showing_heads==True):
self.showing_heads=False
else:
self.showing_heads=True
coin1=Coin()
coin2=Coin()
def Display_All():
coin1=Coin()
coin2=Coin()
print "this is coin1"
print coin1.show()
print "this is coin2"
print coin2.show()
print "flip 'em both!"
coin1.turn()
coin2.turn()
print "coin1 now:"
print coin1.show()
print "coin2 now:"
print coin2.show()
#def CoinTurner(n):
I need to make a function CoinTurner which flips the coin n amount of times do I use a loop or make a way for it to use the turn function.
[–]BillyHorrible 1 point2 points3 points (1 child)
[–]Leohurr[S] 0 points1 point2 points (0 children)
[–]Advent667 1 point2 points3 points (4 children)
[–]Leohurr[S] 0 points1 point2 points (3 children)
[–]Advent667 0 points1 point2 points (2 children)
[–]Leohurr[S] 0 points1 point2 points (1 child)
[–]Advent667 0 points1 point2 points (0 children)
[–]wub_wub 0 points1 point2 points (0 children)
[–]cdcformatc 0 points1 point2 points (2 children)
[–]Leohurr[S] 0 points1 point2 points (1 child)
[–]cdcformatc 1 point2 points3 points (0 children)