zyulfi

Boolean

May 16th, 2025 (edited)
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | Source Code | 0 0
  1. # 9. Булев вход
  2. # Въведете стойност "True" или "False" (като текст).
  3. # Преобразувайте я до bool и отпечатайте:
  4.     # "Истина", ако е True
  5.     # "Лъжа", ако е False
  6.  
  7. text = input("Please enter a value" + " True" + " or "+ "False" + " (as text): ")
  8.  
  9. if text == "True":
  10.     print("True!")
  11. elif text == "False":
  12.     print("False!")
  13. else:
  14.     print("Wrong text!")
  15.  
Tags: boolean
Advertisement
Add Comment
Please, Sign In to add comment