CGSC 1005 Lecture 3: COMP SCI Sept. 12

80 views3 pages

Document Summary

We use the input function to get info from the use we need to assign the user input in to a variable. *the input function will always return what was typed as a string. We can convert info from one type of data to another by calling the appropriate function. Sometimes our program needs to check if something is true or false. To do that we use the bool type (bool = boolean) Bool only has two possible values: true and false note, upper case. Wanting to check if the following is true: weather is sunny and the weather is warm. And takes 2 boolean arguments and returns if both are true. Or takes 2 boolean arguments and returns if one (or both) is/are true. Not takes 1 boolean argument and returns the opposite of it x = true y = false print (x or y) X = true so it prints the entire statement as true.

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