zy 168 ch 3 Warm up:c XY 161NjoguFal 2017/chapter/16/sect id=23410041 ZyBooks Li
ID: 3593076 • Letter: Z
Question
zy 168 ch 3 Warm up:c XY 161NjoguFal 2017/chapter/16/sect id=23410041 ZyBooks Library > CST 161 home> 16.8: Ch 3 Warm up: Creating passwords (Python 3) Help/FAC (3) Output the length of each password (the number of characters in the strings). (Submit for 2 points, so 5 points total) Enter favorite color: yellow Enter pet's name Daisy You entered: yellow Daisy6 First password: yellow Daisy second password: 6yellow6 Number of characters in yellow Daisy: 12 Number of characters in 6yellow68 LAB ACTIWTY 16.8.1 Ch 3 Warm up, Creating passwords (Python 3) Load defExplanation / Answer
color = input("Enter your favorite color: ").strip()
name = input("Enter the pet's name: ").strip()
num = int(input("Enter a number: "))
print("You entered:",color,name,num)
firstPassword = color+"_"+name
secondPassword = str(num)+color+str(num)
print("First Password:",firstPassword)
print("Second Password:",secondPassword)
print("Number of characters in",firstPassword,len(firstPassword))
print("Number of characters in",secondPassword,len(secondPassword))
Output:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.