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