TGViewer
Python tests Python tests @python_testit · 6.9K subscribers
Post #1109 1.84K
❓ Что выведет этот код?

A) 1
B) -1
C) 2
D) 0

❗️ Ответ: B (-1). Объяснение:

🔍 ~ — побитовый оператор НЕ, он инвертирует все биты числа и вычисляет -(n+1) для числа. Поэтому 4 становится -( 4+1)= -5.
More from @python_testit
  1. Sep 6, 2026🐍 Python считает эти даты равными. Хотя между ними целый час В ночь перевода часов время…
  2. Aug 14, 2026Post #1269
  3. Aug 14, 2026photo post
  4. Aug 14, 2026🔥 Python + AI без игрушечных демок. Курс для тех, кто хочет собирать рабочие системы. Ste…
  5. Jul 22, 2026Post #1266
  6. Jul 22, 2026photo post
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →