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