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