Level 1 : What is the output of the below Python program?


a,b,c,n = 0,1,0,10
c = a+b
n = n-2
while n>0:
    print(c, end=" ")
    a = b
     b = c
     c = a+b
     n = n-1

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