CSCA08H3 Lecture 1: CSC108 - Week 1 Notes

172 views4 pages
1 Mar 2016
School
Course
Professor

Document Summary

Addition: eg. 2 + 3 returns 5. Subtraction: eg. 2 - 1 returns 1. Multiplication: eg. 3 * 4 returns 12. Exponentiation: eg. 2 ** 3 returns 8. Division: eg. 4 / 2 = 2. 0: notice the decimal value. Dividing like this will create a oat type. Adding, subtracting, and multiplying integers (of type int) will return values of type int. Integer division: eg. 4 // 2 returns 2: eg. 2 // 3 returns 0, eg. 5/3 returns 1, we get back a number of type int. 2 divides into 3 less than once, so we get back 0. Modulo (remainder): eg. 4 % 2 = 0 (verbalized 4 mod 2 : eg. 2 % 3 returns 2. Since 2 does not divide into 3, there is 2 remainder: eg. 5 % 3 = returns. Since 5 divides once into 3, there is a remainder of 2 that remains undivided. Order of operations: generally left to right.

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