IT 140
Section 4.14 - IT 140_ Introduction to Scripting v3.pdf !4.13 Additional practice: Dice statistics "4.15 LAB: Password modifier 4.14 LAB: Count input length without spaces, periods, or commas Given a line of text as input, output the number of characters excluding spaces, periods, or commas. Ex: If the input is: Listen, Mr. Jones, calm down. the output is: 21 Note: Account for all characters that aren't spaces, periods, or commas (Ex: "r", "2", "!"). 247772.2201088.qx3zqy7 LAB ACTIVITY 4.14.1: LAB: Count input length without spaces, periods, or commas 0 / 10 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the Trst 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) # Output (shown below) Program output displayed here Signature of your work History of your effort will appear here once you begin working on this zyLab. ma...py Load default template... user_text = input() ''' Type your code here. ''' Develop mode Submit mode Run program What is this? Feedback? 1 2 3 4 My library > IT 140: Introduction to Scripting v… > 4.14: LAB: Count input length without spaces, per…$ % & Jessica Coupar' ( https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/13 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/15 https://learn.zybooks.com/library https://learn.zybooks.com/zybook/SNHUIT140v3 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/14 Section 4.15 - IT 140_ Introduction to Scripting v3.pdf !4.14 LAB: Count input length without spaces, periods, or commas "4.16 LAB: Warm up: Drawing a right triangle 4.15 LAB: Password modi3er 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:
[email protected]*s Hint: Python strings are immutable, but support string concatenation. Store and build the stronger password in the given password variable. 247772.2201088.qx3zqy7 LAB ACTIVITY 4.15.1: LAB: Password modiRer 0 / 10 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the Rrst 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) # Output (shown below) Program output displayed here Signature of your work History of your effort will appear here once you begin working on this zyLab. ma...py Load default template... word = input() password = '' ''' Type your code here. ''' Develop mode Submit mode Run program What is this? Feedback? 1 2 3 4 My library > IT 140: Introduction to Sc… > 4.15: LAB: Password modiRer$ % & Jessica Coupar' ( https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/14 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/16 https://learn.zybooks.com/library https://learn.zybooks.com/zybook/SNHUIT140v3 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/15 Section 4.16 - IT 140_ Introduction to Scripting v3.pdf !4.15 LAB: Password modifier "4.17 LAB: Mad Lib - loops 4.16 LAB: Warm up: Drawing a right triangle This program will output a right triangle based on user speci5ed height triangle_height and symbol triangle_char. (1) The given program outputs a 5xed-height triangle using a * character. Modify the given program to output a right triangle that instead uses the user-speci5ed triangle_char character. (1 pt) (2) Modify the program to use a loop to output a right triangle of height triangle_height. The 5rst line will have one user-speci5ed character, such as % or *. Each subsequent line will have one additional user-speci5ed character until the number in the triangle's base reaches triangle_height. Output a space after each user-speci5ed character, including a line's last user-speci5ed character. (2 pts) Example output for triangle_char = % and triangle_height = 5: Enter a character: % Enter triangle height: 5 % % % % % % % % % % % % % % % 247772.2201088.qx3zqy7 LAB ACTIVITY 4.16.1: LAB: Warm up: Drawing a right triangle 0 / 3 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the 5rst 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) # Output (shown below) Program output displayed here Signature of your work History of your effort will appear here once you begin working on this zyLab. ma...py Load default template... triangle_char = input('Enter a character:\n') triangle_height = int(input('Enter triangle height:\n')) print('') print ('* ') print ('* * ') print ('* * * ') Develop mode Submit mode Run program What is this? Feedback? 1 2 3 4 5 6 7 8 My library > IT 140: Introduction to Sc… > 4.16: LAB: Warm up: Drawing a right tria…$ % & Jessica Coupar' ( https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/15 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/17 https://learn.zybooks.com/library https://learn.zybooks.com/zybook/SNHUIT140v3 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/16 Section 4.17 - IT 140_ Introduction to Scripting v3.pdf !4.16 LAB: Warm up: Drawing a right triangle "5.1 User-defined function basics 4.17 LAB: Mad Lib - loops Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Write a program that takes a string and an integer as input, and outputs a sentence using the input values as shown in the example below. The program repeats until the input string is quit and disregards the integer input that follows. Ex: If the input is: apples 5 shoes 2 quit 0 the output is: Eating 5 apples a day keeps the doctor away. Eating 2 shoes a day keeps the doctor away. 247772.2201088.qx3zqy7 LAB ACTIVITY 4.17.1: LAB: Mad Lib - loops 0 / 10 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the Srst 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) # Output (shown below) Program output displayed here Signature of your work History of your effort will appear here once you begin working on this zyLab. ma...py Load default template... ''' Type your code here. ''' Develop mode Submit mode Run program What is this? Feedback? 1 My library > IT 140: Introduction to Sc… > 4.17: LAB: Mad Lib - loops$ % & Jessica Coupar' ( https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/16 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/5/section/1 https://learn.zybooks.com/library https://learn.zybooks.com/zybook/SNHUIT140v3 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/4/section/17