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