Level 10 : What will be the output of this program?


arr = [3 , 2 , 5 , 6 , 0 , 7, 9]  
add1 = 0  
add2 = 0  
for elem in arr:  
    if (elem % 1 == 0):  
        add1 = add1 + elem  
        continue  
    if (elem % 3 == 0):  
        add2 = add2 + elem  
print(add1 , end=" ")  
print(add2)

Author: KaivalyaG | Tags: datatype | 1736+ Python FAQs | Share
else-statement | dictionaries | objects | recurssion | namespace | classes | pep | oop | file-handling | init | while-and-for-loop | exception-handling | input-function | arithmetic-operation | matplotlib | polymorphism | map-function | datatype | debugging | import-method | file | global | math-copysign | random-function | list-comprehension | nested-loop | docstring | generators-in-python | tuple-unpacking | while-else-loop | identity-operator | memory | virtual-environment | asyncio-module | filter | virtual-environment | lambda | python-django | magic-method | matrix | exponentiation | name-mangling | odd-number | lists | def | syntaxerror | immutable-data-type | copy | variable | functions | loop-control | class | binary | descriptors | precedence-and-associativity | multiprocessing | floating-point-precision | sorting | yield | fabs-function | iterator | feature | bitwise-operator | assert | condition | encapsulation | indentation | min-max-function | python-repl | string-method | id-function | binary-operation | class-and-object | list-indexing | list-slicing | tuple | collection | numpy | encoding | global-variable | oops | zip | regex | control-flow | deep-copy | __future__ | precedence | async | boolean-and-non-boolean | set | control-flow | data-type | pickling-&-unpickling | implementation | dictionary | postfix | methods | built-in-function | string-formatting | datetime | turtle | string-concatenation | __all__-attribute | string-slicing | complex | choice | integer | max-min | conditional-statement | random | basic | package-management | generator | for | call | input-function | data_structure | version-check | destructor | int | return-statement | type_conversion | math | collections | filter-function | loop | dicts | round | sys-module | function | file_handling | class-and-inheritance | statement | data-structures | typeerror | syntax-error | generators | python-history | interpreter | software-design | memory-management | append | benefit | matrix-list-comprehension | higher-order-function | numeric | touples | type-conversion | syntax | sys | comprehension | string-manipulation | error | comment | list-mutation | mathematics | access-modifier | scientific-notation | shallow-copy | update | operand | expression | frozenset | bitwise-operator | command-line-parsing | assignment-operator | sum-function | list-method | counter-function | operator-or | format | attribute | list-join | escape-operator | data-structure | global-keyword | heap-memory | library | namedtuple | range | min-function | list | with-statement | overflow | object-attribute | functional-programming | data-structure | mysql | regular-expression | goto-function | enumerate() | syntax-error | type-conversion | default-mutable-argument | factorial-function | split | pandas | error-handling | raise | conversion | string-slicing | decimal | exception | list-operation | array | stack | list-vs-tuple | indexing | invalid-list | function-and-scope | sum() | boolean | string-iteration | operator-overloading | iterable | python_version | immutability | operators | list-comprehension | string-method | threading | center | data-type | exception-handling | recursion | __init_subclass__ | operations | method | string-formatting | print-statement | conditional-statement | design-principle | slicing | mutable | comparison | multithreading | built-in | class-and-instance-variable | python | application | print | file-handling | round-function | built-in-function | inherit | loops | keyword | context-manager | formal-and-actual-parameter | inheritance | static-method | slice | lambda-function | rollback | multiple-inheritance | counter | identifier | expand-tab | installation | mapping-function | constructor | identity-operator | while-loop | mathematical-function | match | zip-function | input | operator-and | compute | join | parameter | control-statement | complex-number | sorted | thread | string | logical-operator | swapping | set-operation | logical-operation | zfill-function | arithmetic-expression | python-module | gil | bitwise | function-argument | lambdas | decorator | asyncio | staticmethod | head-and-tail | operator | logical-operator | module | pseudocode | global-variable | version ...