Level 1 : What type of result that returns the below code, if the input 1s 23?


num = int(input("enter a number: "))

flag = False
if num > 1:
    for i in range(2, num):
        if (num % i) == 0:
            flag = True
            break
if flag:
    print(num)
else:
    print(num)

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