Level 1 : What will be the output of the following Python code?


def f1():
    x=100
    print(x)
x=+1
f1()

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