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