Level 1 : What will be the output of the following code?


a = ~4
b = a + 4
print (b)

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