Dec-08-2019, 08:25 AM
# User input rightNotes = "c4 e4 g4 c5" # Convert user input to numbers text2Numbers = {'c4': 40, 'e4': 44, 'g4': 47, 'c5': 52} rightNotesList = rightNotes.split() print(rightNotesList) # Question: how to transport and convert the text from rightNotesList from text2Numbers in the # rightNumbers list? rightNumbers = [] print('converted numbers:') print(rightNumbers) # Desired result in this example: # [40, 44, 47, 52] # If rightNotes(user input) is for example 'c4' the output should be '[40]'.After I understand this I can make the full dictionary for all musical pitches!