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