Level 9 : What is the output of the following code?


try: 
     if '1' != 1:
         raise"some error"
     else: 
        print("some error has not occurred")
except "someError":
    print("someError has occured")

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