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