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