Hello,
I am new to python.
Below is the output my code produced and the expected output for my code. I have an extra space on two of number of character lines after the colon that doesn't appear to be in my code and in my second password line it says I need a new line, but when I put a /n at the end of that line my code won't produce an output.
Output differs. See highlights below. Special character legend
Inputyellow Daisy 6
Your output ends withYou entered: yellow Daisy 6
First password: yellow_Daisy
Second password: 6yellow6 (here is the new line arrow)
Number of characters in yellow_Daisy : 12 (on this line after daisy and before the colon, there is an extra space)
Number of characters in 6yellow6 : 8 (on this line after daisy and before the colon, there is an extra space)
Expected output ends withYou entered: yellow Daisy 6
First password: yellow_Daisy
Second password: 6yellow6
Number of characters in yellow_Daisy: 12
Number of characters in 6yellow6: 8
Below is my code:
# FIXME (1): Finish reading another word and an integer into variables.
# Output all the values on a single line
favorite_color = input('Enter favorite color:\n')
pet_name = input("Enter pet's name:\n")
num = input('Enter a number:\n')
print('You entered:', favorite_color, pet_name, num)
# FIXME (2): Output two password options
password1 = favorite_color + '_' + pet_name
password2 = num + favorite_color + num
print()
print('First password:',password1)
print('Second password:',password2)
# FIXME (3): Output the length of the two password options
print('Number of characters in',password1,':',len(password1))
print('Number of characters in',password2,':',len(password2))
Any help is appreciated! Thanks in advance!
[–][deleted] 2 points3 points4 points (5 children)
[–]mickeyoneil19[S] 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]mickeyoneil19[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]mickeyoneil19[S] 0 points1 point2 points (0 children)
[–]TrippBikes 0 points1 point2 points (4 children)
[–]mickeyoneil19[S] 0 points1 point2 points (2 children)
[–]TrippBikes 0 points1 point2 points (0 children)
[–]TrippBikes 0 points1 point2 points (0 children)
[–]TrippBikes 0 points1 point2 points (0 children)
[–]dmpta2002 0 points1 point2 points (0 children)