0
Password - message
Password - message Minimum length is 6 Maximum length is15. Print appropriate messages for each condition. Password - message. The passwords are inputs. ABd1234@1-Password is Okay. abc-Password is too short. PasswordIsVeryVeryVeryLong - password is very long
27 odpowiedzi
+ 7
Ok so basically the input has to be saved in a variable so you might want to write:
some_var=input('Password enter by the user:')
Then it is good that you did this:
max_length=15
min_length=6
Next you don't need to do this because it will be handled in the if statement: (and by the way the syntax is wrong anyway)
password=max_length and min_length
And your test will work but is not really correct: try this instead:
if password <min_length:
print('Password is too short')
elif password>max_length:
print('password is very very long')
else:
print('password is okay')
+ 6
Sure do something and I'll help you along 😕😕 there's no point in me doing your assignement....😕😕
+ 6
It's not bad ! Still there are some problems:
1) You used some variables that you didn't assign/declare
2)The test (if statement) should be improved to something like:
if password <min_length:
print('Password is too short')
elif password>max_length:
print('password is very very long')
else:
print('password is okay')
/!\ note that as mentioned in 1) max_length and min_length are not defined (and they are not the only ones...)
+ 6
Well you should think "What is the variable password ?" And when you have the answer "tell" the same thing to python (and same with the others too)
+ 6
Yes here is the final (and correct) form:
if len(Some_var)<min_length:
print('Password is too short')
elif len(Some_var)>max_length:
print('password is very very long')
else:
print('password is okay')
+ 5
Oh I see well I hope that now you know a little better about how things go around here 😊😊
And welcome to our friendly and awesome community ! 👋👋
+ 4
You're welcome 😉😆
+ 4
How about you make something and we see if you need any help? 😆😆
+ 4
Oh sorry because in the test it is:
if Some_var <min_length:
print('Password is too short')
elif Some_var>min_length:
print('password is very very long')
else:
print('password is okay')
+ 3
Is this a question or a challenge you're posting?
+ 3
Oh then if it is a question could you post your attempt please?
+ 3
Well if it is not a question to help you resolving the task and it is just a challenge type question you shall post it in your personal feed or in an already existing thread that is for this purpose ;)
https://www.sololearn.com/discuss/1316935/?ref=app
+ 3
I mean try to think about the code (at least the algorithm....)
+ 3
You're welcome I'm glad I could help you ! 😆😆
Happy coding !👍👍
0
Question with some what challenge Uni
0
Input : password entered by the user
Output can be based on
1) if the input password string length is less than 6 then output as password is very short
2) if the input password string length lies between 6 and 15 then output as password is okay
3) if the input password string length is greater than 15 , then output as password is very long
I think this answer might be helpful to u
0
Just hints
0
I'm new here.
0
Thank you
0
I'm a beginner so just help me with that