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