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