20 AnswersNew Answer
I have written the solution satisfying all the conditions but still it is failing 7/13 test cases. Can somebody please explain what is wrong in my solution Question : https://www.sololearn.com/coach/76?ref=app Solution : https://code.sololearn.com/caprhA3HfWdY/?ref=app
1/22/2020 5:47:20 PMPrakhar Srivastava
20 AnswersNew Answer
Prakhar Srivastava Don't be sorry, you worked out the problem. Well done. Honours to Jayakrishna for his assistance
Jayakrishna ok i am very sorry to waste your time.I actually forgot to import java.util package.Now it is working fine,all test cases passed.I apologize again.Thanx👍
Rik Wittkopp Thank you....
Can you show your code? Or else specify which one going wrong... And pls tag language you are trying...
What is that error? Show me.. Add in code.. Other than that every thing seems perfect...
Rik Wittkopp thanx to you also for looking into the problem.Cheers 👍
When it comes to coding everything has to be perfect so there must be a problem with the coding itself or the import.
Adam Szekely yes you are absolutely correct 👍
Are you allowing for Upper and Lower case letters?
Jayakrishna i have posted the code,the upper link has the question and lower link has the solution.
Rik Wittkopp the question does not have any boundation on the case of letters.
Prakhar Srivastava The input you should give by Scanner methods not by command line arguments...
Jayakrishna yes i know i initially tried with Scanner class but it shows an error in the creation of Scanner object.
Prakhar Srivastava It's OK... Fine, Not a ploblem at all.. You are always Welcome...
Jayakrishna that's so considerate of you.Thanx again 👍✌️🙂
my neym is anonim xarjerbord
yogesh nandal Better to make your own question always.. Also your question is python.. So Try these first then make question or use search bar for python answer... First if it length is less than 7, need to print Weak, and stop further execution so exit there otherwise it prints 2 times Weak. Next remove 10 and 15 lines. It executing length of input times instead of only 1 time.. By these changes, your code works fine.
#please check what I'm doing wrong p=str(input()) p.strip() #remove spaces say='Weak' spchar=['!', '@', '#', '$', '%', '&', '*'] nums=['0','1','2','3','4','5','6','7','8','9'] if len(p)<7: print(say) a,b=, for i in range(len(p)): for j in range(len(spchar)): x=p.count(spchar[j]) #count all chars-p if(x!=0): str(a.append(x)) #store non-0 result for o in range(len(p)): for k in range(len(nums)): #count all num-p y=p.count(nums[k]) if(y!=0): str(b.append(y)) #store non-0 result c,n=sum(a),sum(b) #sum of all chars/nums found if (c>=2 and n>=2): say='Strong' print(say)
Jayakrishna🇮🇳 thanks a lot buddy. I will take care of it in future.
Learn Playing. Play Learning
Send us a message