Nov-20-2018, 02:47 AM
1 2 3 4 5 6 7 8 |
a = [] k = 1 for x in range ( 0 , 10 ): a.append( int ( input ())) for x in range ( 0 , 30 ): if (a % 2 = = 0 ): k = k * a print (k) |
unsupported operand type(s) for %: 'list' and 'int'
|
||||||||||
Nov-20-2018, 02:47 AM
Because "a" is a list, you cannot simply perform mathematics with it. You can iterate over "a" and take the modulus of each number in it:
to get your list:
for numeric:
May-07-2022, 07:28 AM
(This post was last modified: May-07-2022, 07:28 AM by cool_person.)
answer ASAP
May-07-2022, 08:07 AM
Look at your append. You need ()
I welcome all feedback.
The only dumb question, is one that doesn't get asked. My Github How to post code using bbtags Download my project scripts | ||||||||||
|