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