Is there a problem in line 2? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

Is there a problem in line 2?

lower, upper, special, digit = 0, 0, 0, 0 password = input(str) if (len(password) >= 7): for i in password: if(word[0].isupper()): upper += 1 if(i.islower()): lower += 1 if(i.isdigit()): digit += 2 if(i == '@' or i == '

#x27; or i == '_' or i == '#'): special += 1 else: print("Password should be more than 6 characters") if (lower >= 1 and upper >= 1 and special >= 1 and digit >= 1): print("Strong") else: print("Weak")

19th Oct 2021, 7:41 PM
Tree
Tree - avatar
13 Answers
+ 4
Yes, remove this 'str' to password = input()
19th Oct 2021, 7:46 PM
Coding Cat
Coding Cat - avatar
+ 2
you can just use password = input() If you do not set it to lets say an integer like int(input()) it will automatically assume it is a string. Hope this helps!
20th Oct 2021, 9:17 AM
WebFreak
WebFreak - avatar
+ 1
Yes, there must be also an other issue. But I'm not so fast 😉
19th Oct 2021, 7:49 PM
Coding Cat
Coding Cat - avatar
+ 1
Coding Cat Task: Write a program that takes in a string as input and evaluates it as a valid password. The password is valid if it has at a minimum 2 numbers, 2 of the following special characters ('!', '@', '#', '
#x27;, '%', '&', '*'), and a length of at least 7 characters. If the password passes the check, output 'Strong', else output 'Weak'.
19th Oct 2021, 7:49 PM
Tree
Tree - avatar
+ 1
There are many issues. I'm on work
19th Oct 2021, 7:56 PM
Coding Cat
Coding Cat - avatar
+ 1
Maybe this is better. DON'T DO MORE AS YOU HAVE TO DO! And for code coach, Do NOT make any outputs more as they ask for! https://code.sololearn.com/ciT2skV07385/?ref=app
19th Oct 2021, 8:03 PM
Coding Cat
Coding Cat - avatar
+ 1
Now there are special characters missing. In the text above I see seven. But only four are checkt in your code.
19th Oct 2021, 8:07 PM
Coding Cat
Coding Cat - avatar
+ 1
Very nice. Gern geschehen.
19th Oct 2021, 8:39 PM
Coding Cat
Coding Cat - avatar
0
Coding Cat Thanks. I did it. The result must be "Strong" but now is "no Output"
19th Oct 2021, 7:47 PM
Tree
Tree - avatar
0
Coding Cat thanks Coding Katze. What is wrong with this? https://code.sololearn.com/cPHFaacz5f25/?ref=app
19th Oct 2021, 8:16 PM
Tree
Tree - avatar
0
Idk. Some broken spaces maybe from copy and paste. I've deleted this if sequence and have it rewritten. https://code.sololearn.com/cST08FWLjqIS/?ref=app
19th Oct 2021, 8:23 PM
Coding Cat
Coding Cat - avatar
0
And the digits are now missing if(i.isdigit()): digit += 1
19th Oct 2021, 8:26 PM
Coding Cat
Coding Cat - avatar
19th Oct 2021, 8:33 PM
Tree
Tree - avatar