Ask coding questions

← Back to all posts
Quiz Coding
KeshavNair

I am making code for a quiz. In the quiz, I want to make sure that when a user selects a certain answer, the program would display "true" or "false". How would I make this happen

Voters
KeshavNair
Comments
hotnewtop
PYer

Define a variable called answer that gets the user's selected answer using the input() function. Then create an if statement checking what the user entered, and then printing "True" or "False".
Example:

doesthiswork

how do you do this in python

[deleted]

What language are you using?

KeshavNair

@ItsEmpCs javascript