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