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