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