Last answered:

04 Dec 2023

Posted on:

01 Dec 2023


Resolved: İntro to conditionals

İn the task below:

x = 5
y = 6
print('x =',x,'y =',y)
print('Checking less than with \'<\':',x < y)
print('Checking greater than with \'>\':',x > y)

İs the sign < or > should always be written with with ':' expression ? 

1 answers ( 1 marked as helpful)
Posted on:

04 Dec 2023


Hey Khadija,

Thanks for reaching out!

The <, >, and : symbols are all part of a print-statement. Inside the print-statement, there is a set of esaped quotation marks such that the printed text becomes:

Checking less than with '<':

To answer your question, < or > don't need to be followed by a colon.

If you need a refresher on strings, please refer to the following lectures:

Kind regards,

365 Hristina

Submit an answer