Trying to solve matching passwords in python core | Sololearn: Learn to code for FREE!

0

Trying to solve matching passwords in python core

password = input() repeat = input() def validate(text1, text2): if password == repeat: print("Correct") else: print("Wrong") Don't know what is wrong with my code

4/6/2021 10:23:38 AM

Simisola Osinowo

6 Answers

New Answer

+3

password = input() repeat = input() if password == repeat: print("Correct") else: print("Wrong")

+1

You are given a program with two inputs: one as password and the second one as password repeat. Complete and call the given function to output "Correct" if password and repeat are equal, and output "Wrong", if they are not. Sample Input nfs1598 nfs1598 Sample Output Correct

+1

0

0

Referring to your original attempt, there were a number of problems. 1. It appears there is an indentation problem. but that may happened when you posted your attempt. 2. Your def refers directly to your inputs instead of referring to your def ( values) Remember that defs tend to isolate the code within until called. 3. You never called your def to create an output. I have attached a working version of your code for reference. password = input() repeat = input() def validate(text1, text2): if text1 == text2: print("Correct") else: print("Wrong") validate(password, repeat)

0