Section 4

.pdf

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

H4383

Subject

Computer Science

Date

Apr 3, 2024

Type

pdf

Pages

2

Uploaded by brienncaervin

Report
3/30/24, 6:56 AM Section 4.15 - IT 140: Introduction to Scripting | zyBooks https://learn.zybooks.com/zybook/IT-140-H4383-OL-TRAD-UG.24EW4/chapter/4/section/15 1/2 4.15 LAB: Password modi±er Many user-created passwords are simple and easy to guess. Write a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending "q*s" to the end of the input string. i becomes ! a becomes @ m becomes M B becomes 8 o becomes . Ex: If the input is: mypassword the output is: Myp@ssw.rdq*s Hint: Python strings are immutable, but support string concatenation. Store and build the stronger password in the given password variable. 555192.3976772.qx3zqy7 LAB ACTIVITY 4.15.1: LAB: Password modi±er 10 / 10 main.py Load default template... original_password = input () final_password = '' i = 0 while i < len ( original_password ): ch = original_password [ i ] if ch == 'i' : final_password += '!' elif ch == 'a' : final_password += '@' elif ch == 'm' : final_password += 'M' elif ch == 'B' : final_password += '8' elif ch == 'o' : final_password += '.' else : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
3/30/24, 6:56 AM Section 4.15 - IT 140: Introduction to Scripting | zyBooks https://learn.zybooks.com/zybook/IT-140-H4383-OL-TRAD-UG.24EW4/chapter/4/section/15 2/2 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the ±rst box, then click Run program and observe the program's output in the second box. Enter program input (optional) If your code requires input values, provide them here. Input (from above) main.py (Your program) O Program output displayed here Coding trail of your work 3/30 S 0,0,0,10,10 min:10 else : Develop mode Submit mode Run program What is this? Feedback? 17
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help