 # Coin Flip Game

Looking for feedback on my Coin Flip code based on:
Computer Science Independent Project #1 – Coin Flip.

Here is my code!

# Totals include how many games were played, and how many times they guessed correctly

import random

correctGuesses = 0
gamesPlayed = 0

playGame = 0
while playGame == 0:

# User must guess heads or tails

``````count = 0
while count < 1:
user_guess = input('Guess heads or tails (type \'h\' for heads, \'t\' for tails): ')
guess = user_guess.lower()
if guess == 'h':
count += 1
if guess == 't':
guess = 'Tails'
count += 1

``````

# The random flip of the coin

``````def heads_or_tails(flip):
return random.choice(flip)

``````

# The result

``````if coinFlip == guess:
print(coinFlip + '!, you guessed correctly!')
correctGuesses += 1
gamesPlayed += 1
print('Total Correct Guesses: ' + str(correctGuesses))
print('Total Games Played: ' + str(gamesPlayed))
else:
print(coinFlip + ', sorry you guessed incorrectly...')
gamesPlayed += 1
print('Total Correct Guesses: ' + str(correctGuesses))
print('Total Games Played: ' + str(gamesPlayed))
``````

# Asking if user wants to play again

``````flipAgain = input('Do you want to flip again? (enter \'YES\' or \'NO\') ')
playAgain = flipAgain.lower()
if playAgain == 'no':
playGame += 1
elif playAgain != 'yes' or playAgain != 'no':
flipAgain = input('TRY AGAIN. Do you want to flip again? (enter \'YES\' or \'NO\') ')
playAgain = flipAgain.lower()
if playAgain == 'no':
playGame += 1``````