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