Unit 5 Lesson 8 Level 4 Line 8

csp-unit-5-lesson-8

#1

In line 8 it says (“Julio” > firstName) which evaluates to false. The instructions direct students to change only the operator to make the statement evaluate to true. The solution is the change the greater than to a less than. Can someone explain why this makes the statement true?


#2

Possibly because J is “less than” M in the alphabet? I seem to recall that that’s how alpha-strings are compared. Someone else please confirm. Thanks for asking this question.


#3

@christinarconnor is correct. Here is a good explanation:


#4

Thank you! Did I miss this in the lesson somewhere?


#5

If you did, I did too! I tested Nick > firstName which came back true and I wanted more of an explanation so I searched it up.