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