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