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