Level 6 : What is the output of the following code?


def exem():
   return x+1
x = 2
print(exem())

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