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