Level 6 : 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 | 1859+ Python FAQs | Share
descriptors | mysql | encapsulation | exception | data-structures | implementation | counter | data-type | dictionary | compute | default-arguments | data-structures-in-python | constructor | generator | file | default-mutable-argument | lambda-function | enumerate() | fabs-function | dataframe-and-series-objects | virtual-environment | function-and-scope | assignment-operator | data_structure | list,-set,-and-dictionary-comprehensions | lists | method | namedtuple | loop-control | filtering-and-indexing | match | multiple-inheritance | expand-tab | list-vs-tuple | matrix | introduction-to-threads | module | else-statement | magic-method | design-principle | object-attribute | __all__-attribute | boolean-masking | async | operator-or | arithmetic-operation | python-module | joining-and-merging-dataframes | list-slicing | math-copysign | append | comprehension | odd-number | random | filter-function | handling-missing-values-(fillna,-dropna) | package-management | destructor | global-variable | mathematics | feature | reading-and-writing-large-files-efficiently | datetime | for | overriding-methods | immutability | exception-handling | application | python-django | array | pep | inherit | input | pseudocode | built-in-function | list-operation | operators | method-overloading | defining-functions | name-mangling | conditional-statement | while-loops | using-yield-in-functions | type-conversion | list-indexing | time-series-with-pandas | control-flow | tuples | typeerror | thread-safe-data-structures-(queue.queue) | class-decorators | list-methods-and-slicing | range | python-operators | aggregating-data-with-functools.reduce() | list-comprehensions | keyword | higher-order-function | generators | else | identifier | inheritance | string-iteration | global-variable | string-methods | frozenset | key-value-pairs | boolean | walking-through-directories-using-os.walk() | operations | error-handling | introduction-to-python | operator-overloading | parsing-with-strptime | sys-module | parameter | integer | floating-point-precision | multiprocessing | counter-function | mapping-function | floats | dictionary-methods | context-manager | logical-operator | using-lists-as-stacks | debugging | access-modifier | dictionaries | conversion | sys | loops | staticmethod | rollback | string-formatting | logical-operators | string-slicing | factorial-function | __init_subclass__ | arbitrary-arguments-(*args,-**kwargs) | init | set-operation | iterable | logical-operation | membership-operators-(in,-not-in) | global-keyword | why-use-multiprocessing-over-threading?-(gil) | matplotlib | zip-function | operator-and | file_handling | version-check | matrix-list-comprehension | loop | version | raise | list-method | data-type | creating-custom-modules | identity-operator | touples | pickling--unpickling | loop-control-statements | indexing:-loc-vs-iloc | logical-operator | reading:-read(),-readline(),-readlines() | iterator | list-mutation | syntaxerror | boolean-and-non-boolean | data-structure | function-argument | class | immutable-data-type | mathematical-function | syntax-error | reading-and-writing-files | while-loop | arithmetic-expression | collection | indexing | functional-programming | threading | recursion | mutable | installation | center | tuple-methods | python-syntax-and-structure | error-handling | expression | quantifiers-(*,-+,-?,-{}) | functions | assignment-operators | python | escape-operator | recurssion | memory | classes | using-os-and-pathlib-modules | comment | python_version | basic | static-method | sum() | exponentiation | scientific-notation | syntax | error | variable | update | control-statement | built-in-modules | while-else-loop | filter | raise-statement | data-type-conversions | gil | exception-handling | docstring | data-structure | precedence | pandas | invalid-list | using-else-and-finally | functional-programming | format | zfill-function | encoding | yield | goto-function | memory-management | collections | sorting-and-ranking | max-min | bitwise | shallow-copy | pass | operand | generators-in-python | comparison | choice | formatting-with-strftime | print-statement | built-in | opening-files-(open()) | class-and-inheritance | literal-characters-and-special-characters | using-assertions-(assertequal,-assertraises) | random-function | oops | binary | call | unit-testing | operator | print | tuple | using-join()-and-is_alive()-methods | regex | tuple-unpacking | creating-and-starting-threads | assert | sorted | sorting | input-function | numpy | benefit | statement | deep-copy | id-function | postfix | decimal | datetime.date,-datetime.time,-datetime.datetime | math | input-function | def | swapping | turtle | string | set | slice | thread | file-handling | advanced-file-operations | asyncio-module | thread-synchronization | numeric | conditional-statements | bitwise-operator | identity-operators-(is,-is-not) | multiple-except-blocks | file-handling | string-concatenation | while-and-for-loop | precedence-and-associativity | copy | asyncio | formal-and-actual-parameter | library | integers | nested-loop | list-join | import-method | stack | multithreading | type-conversion-and-casting | lambdas | function | heap-memory | class-and-instance-variable | round-function | methods | datatype | slicing | min-function | objects | difference-between-threads-and-processes | list | complex-number | type-conversion | regular-expression | list-comprehension | python-repl | using-map()-for-transformations | string-formatting | global | decorator | strings | int | type_conversion | managing-directories-with-os-and-shutil | string-method | directory-operations | booleans | dicts | overflow | syntax-error | attribute | working-with-file-paths | indentation | intering | complex | min-max-function | zip | iterators | string-manipulation | round | sum-function | control-flow | condition | using-the-threading-module | interpreter | class-and-object | writing:-write(),-writelines() | introduction-to-multiprocessing | working-with-binary-files-(rb,-wb) | split | regular-expressions | oop | working-with-temporary-files-using-tempfile | built-in-function | binary-operation | return-statement | working-with-dates-and-times | lambda | __future__ | multiple-inheritance | namespace | virtual-environment | bitwise-operator | lambda-functions | single-inheritance | command-line-parsing | data-types | test-discovery | sets | map-function | conditional-statement | string-slicing | with-statement | software-design | polymorphism | join | python-history | list-comprehension | anchors-(^,-$) | head-and-tail | dictionary-comprehensions | identity-operator | string-method ...