Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LAB 6 . 2 8 . 1 : Lab 3 , Part 1 : Using functions to create passwords 2 ways ACTIVITY Write two different

LAB
6.28.1: Lab 3, Part 1: Using functions to create passwords 2 ways
ACTIVITY
Write two different password creation functions, password10 and password20. We put the first few characters of the header of each in the template for you. Write both of them below.
password1() has 2 input arguments, intended to be two strings s1 and s2
password2() has 3 input arguments, again intended to be two strings s1 and s2, and in the third position a number, n.
Function password1 will return (not print) a string consisting of the two strings separated by an underscore character. Function password2 will return a string consisting of the (characters of) the number n followed by s1 followed by s2 followed by the (characters of)n.
Hint To convert a number, n, to a string use the function str0. For example, str (2+3) will return '5'
If your functions work correctly you would have:
password1('yellow', 'Rose')
yellow Rose
password2('yellow', 'Rose', 42)
42 yellowRose 42
#Remember: We expect that every function you write for CS 113 will have a docstring in the proper place. You will get most of the points for this assignment from the autograder checking that your program behaves correctly, but some points will come from the TA's checking that the docstrings are there.
Suggestion Work on password 1 first, and run with just password 1 in the window below, and work on it until password1 gets full marks on the first three test cases. When you are doing that, you should expect to see a message telling you that you are getting 0 points for the last four test cases.
Run
Reset Lab Tutorial
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

Students also viewed these Databases questions

Question

=+What is your personal mission statement?

Answered: 1 week ago