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