Level 1 : What is the output of the below python code?


num=20
sum=0
while num!=0:
     rem = num%10
     sqr = rem*rem
     sum = sum+sqr
     num = int(num/10)
print("\nSum of squares of digits of given number is: %s"%(sum))

Author: KaivalyaG | Tags: function | 1736+ Python FAQs | Share
classes | binary | variable | string-iteration | implementation | descriptors | data-structure | input | integer | module | string-slicing | pandas | mathematics | oops | inheritance | command-line-parsing | comparison | python-django | round | control-flow | compute | exception-handling | list-comprehension | class-and-instance-variable | data_structure | matrix-list-comprehension | library | package-management | encapsulation | decimal | math-copysign | built-in-function | init | list-method | oop | touples | lists | comprehension | virtual-environment | zip | matrix | input-function | inherit | while-else-loop | iterable | debugging | lambdas | data-structure | magic-method | join | identity-operator | return-statement | staticmethod | data-structures | type_conversion | random-function | random | copy | complex-number | __future__ | file_handling | asyncio | collections | boolean-and-non-boolean | polymorphism | class-and-inheritance | error | raise | zfill-function | class | file | type-conversion | string-method | list-vs-tuple | version-check | postfix | method | data-type | max-min | syntax | logical-operation | choice | destructor | overflow | loop | exception | int | yield | mathematical-function | software-design | memory-management | boolean | operator-and | sum() | with-statement | slicing | application | for | array | mysql | __all__-attribute | list-operation | split | frozenset | list-mutation | matplotlib | control-flow | heap-memory | recurssion | keyword | global | generator | python | while-and-for-loop | object-attribute | pep | goto-function | async | logical-operator | gil | math | file-handling | indentation | feature | basic | loop-control | update | python-module | conditional-statement | file-handling | sys-module | odd-number | tuple-unpacking | expand-tab | string-formatting | bitwise-operator | format | numpy | sum-function | version | indexing | exponentiation | threading | default-mutable-argument | operator-overloading | lambda | iterator | round-function | precedence | operator | syntax-error | multithreading | set | center | operator-or | else-statement | type-conversion | counter | operations | assignment-operator | def | print-statement | __init_subclass__ | functions | expression | parameter | multiprocessing | static-method | constructor | python_version | list-comprehension | bitwise-operator | list-slicing | functional-programming | set-operation | escape-operator | methods | lambda-function | swapping | stack | dictionaries | shallow-copy | immutability | statement | complex | list | id-function | regex | append | regular-expression | namespace | generators-in-python | loops | virtual-environment | global-variable | map-function | tuple | access-modifier | string-manipulation | mapping-function | thread | rollback | python-repl | pickling-&-unpickling | bitwise | call | mutable | comment | arithmetic-expression | installation | import-method | fabs-function | scientific-notation | string-formatting | sorted | immutable-data-type | collection | deep-copy | context-manager | nested-loop | string-slicing | list-indexing | function-and-scope | floating-point-precision | built-in | identifier | string-concatenation | string | logical-operator | conditional-statement | interpreter | decorator | class-and-object | function-argument | design-principle | list-join | memory | while-loop | invalid-list | match | datatype | slice | error-handling | enumerate() | operators | data-type | docstring | min-max-function | datetime | syntax-error | dicts | binary-operation | sorting | filter-function | attribute | function | namedtuple | higher-order-function | typeerror | multiple-inheritance | precedence-and-associativity | exception-handling | factorial-function | head-and-tail | sys | benefit | zip-function | conversion | numeric | identity-operator | pseudocode | string-method | generators | control-statement | python-history | condition | input-function | global-variable | print | arithmetic-operation | built-in-function | recursion | syntaxerror | assert | dictionary | name-mangling | turtle | encoding | asyncio-module | operand | min-function | range | formal-and-actual-parameter | counter-function | global-keyword | filter | objects ...