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