CSCI 1105 Lecture Notes - Lecture 4: Roundoff, Round-Off Error, Decimal Mark

102 views3 pages
Verified Note

Document Summary

Lecture 3 programming with numbers and strings. Python supports the same basic math as a calculator. It can do: addition , subtraction , multiplication , division / You must write out the expressions a bit differently, as it all will be on one line. For example: (a + b) / 2 is written out. We need to make sure we are careful where we use parenthesis, because the program will read it as a + (b / 2) if we do not include brackets. The pedmas system for precedence is also like algebra: parenthesis, exponent, multiply, divide, add, and subtract. If you mix floating-point and integer values, the result is a floating point value as to not cut off the decimal: example: 7 + 4. 0 = 11. 0. If you mix a string with an integer or a floating point value, an error is the result.

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

Related Questions