Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14040

How can I get the correct output in this program?

$
0
0

(1)Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a single line separated by a space. (2) Output two passwords using a combination of the user input. Format the passwords as shown below. (3) Output the length of each password (the number of characters in the strings).

The following is the code I am using to complete this program but I am running into an output error.

    def userdetails():    words = input("Enter a word: ")    word2 = input("Enter a word: ")    numm = input("Enter a number: ")    pw1 = words+"_"+word2    pw2 = numm+words+numm    print("You entered: {} {} {}" .format(words,word2,numm))     print("First password:",pw1)    print("Second password:",pw2)    print("Number of characters in",pw1,":",len(pw1))    print("Number of characters in",pw2,":",len(pw2))userdetails()

InputyellowDaisy6

Your output

Enter a word: Enter a word: Enter a number: You entered: yellow Daisy 6First password: yellow_DaisySecond password: 6yellow6Number of characters in yellow_Daisy : 12Number of characters in 6yellow6 : 8

Your output does not containYou entered: yellow Daisy 6

First password: yellow_DaisySecond password: 6yellow6

I don't know what to do to get the rest of this correct for all the points needed can anyone help me?


Viewing all articles
Browse latest Browse all 14040

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>