cs50

'String index out of range' error and I don't understand why

'String index out of range' error and I don't understand why Question: I’m trying to take an input, drop the vowels, and print the new phrase. Code Here’s the code I’m using. phrase = input("Input: ") for i in range(len(phrase)): if str(phrase[i]) in ["a", "A", "e", "E", "i", "I", "O", "o", "u", "U"]: phrase = …

Total answers: 6

Coin change problem: difference between these two methods

Coin change problem: difference between these two methods Question: I am implementing the coin change problem in python in CS50’s pset6. When I first tackled the problem, this was the algorithm I used: import time while True: try: totalChange = input(‘How much change do I owe you? ‘) totalChange = float(totalChange) # check it it’s …

Total answers: 2