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