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