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