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