Level 3 : Compare the following two Python codes shown below and state the output if the input entered in each case is -6?


CODE 1
import math
num=int(input("Enter a number of whose factorial you want to find"))
print(math.factorial(num))
 
CODE 2
num=int(input("Enter a number of whose factorial you want to find"))
print(math.factorial(num))

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