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