Back to Freecodecamp

Task 16

curriculum/challenges/english/blocks/learn-how-to-offer-technical-support-and-guidance/6620d3003ddaf50aac1bc76d.md

latest1.6 KB
Original Source

--description--

A statement in programming is a line of code that performs a specific action. For example, print("Hello World") is a statement that displays text.

A condition is a test in code that checks if something is true or false. For instance, if x > 5 checks if x is greater than 5.

A conditional is generally an adjective referring to something that depends on a condition or conditions. In programming, it is used to describe any expression or feature that involves logical conditions. It's not limited to explicit "if-then" structure but can also refer to any setup that alters behavior based on conditions, including loops or even ternary operators.

A conditional statement is a statement that only runs if a certain condition is true. For example, if x > 5: print("Large") is a conditional statement. It prints Large only if x is greater than 5.

--questions--

--text--

What is a conditional statement in programming?

--answers--

A line of code that runs without checking any conditions

--feedback--

A conditional statement does involve checking conditions; it's not a line of code that runs without any checks.


A test to see if a program is working correctly

--feedback--

While a conditional statement can help check how a program works, it's primarily used to run code based on conditions, not to test the program.


A statement that outputs a condition

--feedback--

A conditional statement uses a condition to decide whether to execute, but it doesn't output a condition itself.


A statement that only executes if a certain condition is true

--video-solution--

4