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