Work with your partner for the collaborative REPL assignment.
Review string subscripting, slicing and method examples below.
Read and experiment with high-low word-guessing game.
Try these in the IDLE shell, in order, one at a time:
>>> name = 'Ada Lovelace'
>>> name
>>> name.upper()
>>> name.lower()
>>> name.isupper()
>>> upped = name.upper()
>>> upped
>>> upped == name
>>> upped.lower() == name.lower()
>>> upped.isupper()
>>> help(name.islower)
>>> name[0]
>>> len(name)
>>> name[len(name)-1]
>>> name[-1]
>>> name[12]
>>> name[-12]
>>> name[-13]
>>> help(name.find)
>>> name.find(' ')
>>> name[0:3]
>>> name[:3]
>>> name[4:len(name)]
>>> name[4:]
>>> name[4:8].lower()
>>> help(name.count)
>>> name.count('')
>>> name.count(' ')
>>> name.count('a')
>>> name.lower().count('a')
>>> name.center(20)
>>> name.center(20, '*')
From IDLE, Open the file high_low_word_guess.py
from
the high_low_word_guess
folder. Read over the
file.
Run the module in IDLE and then experiment with playing the game.
In the shell, experiment with accessing the words file:
>>> our_file = open('wordle-words.txt')
>>> type(our_file)
>>> lots = our_file.read()
>>> len(lots)
>>> our_file.close()
>>> lots[285:321]