0

What ever I did I can't and you also will find it hard

cd=input() list=[] for i in cd: list.append(int(i)) for i in range(1,len(list)): if i % 2!= 0: list[i] *= 2 list.reverse() def sub9(list): for i in range(len(list)): if list[i]>9: list[i]-9 return list print(sub9(list)) 1 reverse all nums (must be 16) you will take a string as an input make it list 2 multiple every even position by 2 3 subtract 9 from every number greater than 9 4 then the sum of numbers must be modulo 10 like 70 %10 ==0 5 all true true else false Iam stuck at step 3 https://code.sololearn.com/coDLjz66uTPO/?ref=app

11th Sep 2023, 7:27 PM
ZIZO Abd alkawy
6 Answers
+ 2
ZIZO Abd alkawy , After reading the problem statement I lil modified this code...now it passed all test cases ... as you missed to mention about that length should be 16...that only not added in the code... that's why it doesn't work... now check this.... https://code.sololearn.com/cytNJ48XMTXw/?ref=app
13th Sep 2023, 8:28 AM
Riya
Riya - avatar
+ 4
ZIZO Abd alkawy , Try like this, https://code.sololearn.com/ch6022rk6EvC/?ref=app Hope it is helpful 👍
11th Sep 2023, 8:39 PM
Riya
Riya - avatar
+ 1
ZIZO Abd alkawy , I run the code with some inputs for me it worked well...
13th Sep 2023, 8:12 AM
Riya
Riya - avatar
0
Riya It didn't work 😕 Bcz it prints false when it is true Here's something to explain This is a code coach its name is credit card validator you can check it out
12th Sep 2023, 8:56 PM
ZIZO Abd alkawy
12th Sep 2023, 8:56 PM
ZIZO Abd alkawy
0
Print("HeLLo") number1=input('enterthenumberz:') number2=input('enterthenumberz:' result=int(number1 )+int(number2 ) Print (result )
13th Sep 2023, 5:36 PM
YanaL Tarawneh
YanaL Tarawneh - avatar