Password - message | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

10th Dec 2018, 6:17 PM
Thotla Thirupathi
Thotla Thirupathi - avatar
27 Answers
+ 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')
10th Dec 2018, 7:28 PM
Uni
Uni - avatar
+ 6
Sure do something and I'll help you along 😕😕 there's no point in me doing your assignement....😕😕
10th Dec 2018, 6:58 PM
Uni
Uni - avatar
+ 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...)
10th Dec 2018, 7:07 PM
Uni
Uni - avatar
+ 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)
10th Dec 2018, 7:17 PM
Uni
Uni - avatar
+ 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')
10th Dec 2018, 7:41 PM
Uni
Uni - avatar
+ 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 ! 👋👋
10th Dec 2018, 6:47 PM
Uni
Uni - avatar
+ 4
You're welcome 😉😆
10th Dec 2018, 6:51 PM
Uni
Uni - avatar
+ 4
How about you make something and we see if you need any help? 😆😆
10th Dec 2018, 6:56 PM
Uni
Uni - avatar
+ 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')
10th Dec 2018, 7:36 PM
Uni
Uni - avatar
+ 3
Is this a question or a challenge you're posting?
10th Dec 2018, 6:27 PM
Uni
Uni - avatar
+ 3
Oh then if it is a question could you post your attempt please?
10th Dec 2018, 6:36 PM
Uni
Uni - avatar
+ 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
10th Dec 2018, 6:39 PM
Uni
Uni - avatar
+ 3
I mean try to think about the code (at least the algorithm....)
10th Dec 2018, 7:00 PM
Uni
Uni - avatar
+ 3
You're welcome I'm glad I could help you ! 😆😆 Happy coding !👍👍
10th Dec 2018, 7:44 PM
Uni
Uni - avatar
0
Question with some what challenge Uni
10th Dec 2018, 6:34 PM
Thotla Thirupathi
Thotla Thirupathi - avatar
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
10th Dec 2018, 6:37 PM
Thotla Thirupathi
Thotla Thirupathi - avatar
0
Just hints
10th Dec 2018, 6:38 PM
Thotla Thirupathi
Thotla Thirupathi - avatar
0
I'm new here.
10th Dec 2018, 6:46 PM
Thotla Thirupathi
Thotla Thirupathi - avatar
0
Thank you
10th Dec 2018, 6:48 PM
Thotla Thirupathi
Thotla Thirupathi - avatar
0
I'm a beginner so just help me with that
10th Dec 2018, 6:57 PM
Thotla Thirupathi
Thotla Thirupathi - avatar