'Class HangManNames does not get called in the console, need rephrassing?
I try to call this class, but the console returns nothing. Any ideas on how to fix this?
I try to call this class, but the console returns nothing. Any ideas on how to fix this?
I try to call this class, but the console returns nothing. Any ideas on how to fix this?
class HangManNames():
def wincount():
nameQuese = ("M", "i", "h")
winCount = 0
looseCount = 0
if winCount == 3:
print("you win!")
if looseCount == 3:
print("You loose!")
firstInput = input("Insert the first letter: ")
if firstInput == nameQuese[0]:
print("You have the first letter quessed!")
winCount += 1
print("You have" + str(winCount) + "letter guessed!")
else:
looseCount += 1
print("you missed" + str(looseCount) + ", try again")
secondInput = input("Insert the second letter: ")
if secondInput == nameQuese[1]:
print("You have the second letter quessed!")
winCount += 1
print("You have" + str(winCount) + "letter guessed!")
else:
looseCount += 1
print("you missed" + str(looseCount) + ", try again")
thirdInput = input("Insert the third letter: ")
if thirdInput == nameQuese[2]:
print("You have the second letter quessed!")
winCount += 1
print("You have" + str(winCount) + "letter guessed!")
else:
looseCount += 1
print("you missed" + str(looseCount) + ", try again")
HangmanGame = HangManNames
print(HangManNames)
Class call returns nothing in console
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
