Question: PYTHON: Part 4 is done, but 5 is really holding me up. 4. Write Python code that will iterate through the stringsList using a while
PYTHON: Part 4 is done, but 5 is really holding me up.
4. Write Python code that will iterate through the stringsList using a while loop. At each iteration in the list, use a for loop to iterate through each character of that string and convert it to its associated decimal value. Sum the decimal values, and replace the current string value in the stringsList with the computed sum of the decimal values as a string. Output the stringsList variable to the screen 5. Create an empty dictionary object called reversedStringsDictionary Write Python code that will iterate through the stringsDictionary based on the keys in that dictionary using a for loop. This script should reverse the key stored in the dictionary (i.e. Instead of having 'str:3) as the dictionary, the end result would be f'rts':3) and store the reversed key with the same value into the reversedStringsDictionary. Clear the original stringsDictionary and update it with the data from the reversedStringsDictionary variable The original key:value pairs should not be in the dictionary anymore. Only the key:value pairs with the reversed keys should be in the dictionary. Output the stringsDictionary variable to the screen
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
