lundi 9 août 2021

how to choose the first letter of a word?

how do i make a function statement that only chooses the first letter of a choosed word?

def Example():
    WordChoose = random.choice(self.ThreeWords)
    if WordChoose == 'a':
            print('good')
    else:
       print('bad')
       print(WordChoose)

im try to make a hangman type of game but i can seem to get the first letter of a work i tried 'split()' and 'len()' but nothing worked!

i already tried

split()

and

len()



Aucun commentaire:

Enregistrer un commentaire