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