• Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • mChat
    • mChat page
    • Archive
  • Login
  • Register

Hosting Chatter

Hosting and Web Development

  • Board index Main Zone Coding
  • Search

Python: If Statement and Boolean

Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
User avatar
Jason
Site Admin
Posts: 749
Joined: Tue Jul 01, 2025 10:13 am
  • Quote

Fri Jul 25, 2025 6:30 pm

Code: Select all

try:

		one_plus_one = bool(input(Is one plus one two? True or False?:))
	
except ValueError:

		return "Wrong data type. Please type in True or False and be case sensitive."
	
else:

		if(one_plus_one):

		print("Your correct.")

		else:

		print("Sorry, you're incorrect.")

 

POSTREACT(ions) SUMMARY

Top
Post Reply
  • Print view
1 post • Page 1 of 1

Return to “Coding”

Jump to
  • Welcome
  • ↳   Home/Blog
  • ↳   Announcement
  • ↳   Feedback
  • ↳   Introduction
  • Main Zone
  • ↳   All About Hosting
  • ↳   Web Development
  • ↳   Marketing
  • ↳   Coding
  • ↳   Applied Coding
  • ↳   Database Coding
  • ↳   Web Design
  • ↳   Tech Hardware
  • Buy/Sell
  • ↳   Hosting Offers
  • ↳   3rd Party Services
  • ↳   Post Exchanges
  • ↳   Posting Service
  • Chill Zone
  • ↳   Any-Topic
  • ↳   Site Showcase
  • ↳   Offline Sites
  • Social Media
  • ↳   Hosting Chatter
Advanced search

Login  •  Register



  • Board index
  • All times are UTC
  • Delete cookies
  • Privacy
  • Terms
  • Contact us
 

 

Powered by phpBB™ • Design by PlanetStyles Powered by MathJax