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