Question: Question 4 Write, test and document a Python program, in a file called pas.s_code. py, to solve the following problem using a nested loop. Gerard

 Question 4 Write, test and document a Python program, in a

Question 4 Write, test and document a Python program, in a file called pas.s_code. py, to solve the following problem using a nested loop. Gerard the Gatekeeper has become a little bored with his job. For fun, he likes to make up interesting passwords for guests to use to pass through his gate. For an extra bit of fun, he likes to encode these passwords into a numeric code to see if his guests can figure them out. He is now the least favourite gatekeeper in the land. To help Gerard with his fun, you are asked to write a Python program that takes a series of passwords (to be entered by Gerard) and, for each given password, generates a new coded password where each character in the original password is replaced with its ASCII code (the numerical representation of the character) using the ORD ( ) function. Your program should print the original password and the coded password, for each of the given passwords. Assume that the number of passwords to be processed is not known, hence a sentinel value (maybe "zzz") should be used. For example, if the input is as follows: whalefuzle widdershins Gubbins pandiculation zzz The expected output would be: Enter a password or zzz to finish: whalefuzle The given password is whalefuzle The coded password is 11910497108101102117122108101 Enter a password or zzz to finish: widdershins The given password is widdershins The coded password is 87105100100101114115104105110115 Enter a password or zzz to finish: Gubbins The given password is Gubbins The coded password is 711179898105110115 Enter a password or zzz to finish: pandiculation The given password is pandiculation The coded password is 112971101001059911710897116105111110 Enter a password or zzz to finish: zzz

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!