CSE 1010 Lecture Notes - Lecture 5: Relational Operator

61 views2 pages
Verified Note

Document Summary

Cse 1010 - introduction to computer science and engineering. True and false are the only boolean values. The type is shown as A boolean value is the result of a relational expression. The double equal operator tests for equality: Relational operator example: (note: the (c) is called a centigrade) >>> temp = int(input( enter the temperature (c): )) This whole command is an assignment statement, but the temp < 0 is also the relational expression (you don"t need to know this difference for the exam) The if statement (also known as the conditional or choice statement) This statement is also known as a conditional statement. It has two basic forms: if condition: consequent if condition: consequent else: alternate. Remember to use indentation for this! (either four spaces or hit tab in idle) The consequent and alternate are groups of one or more statements.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents