CSCI 1105 Lecture Notes - Lecture 4: Floating Point, Roundoff, Microsoft Powerpoint

85 views3 pages
Verified Note

Document Summary

Python supports all basic math (add +, subtract -, multiply *, divide /) Order as in math: parenthesis, exponent, multiply/devide, add/subtract (from left to right) Mix integer and floating-point values = floating-point value. (example: 7 x 3. 0 = 21. 0) Double stars (**: are exponent in python. (example: 5**6 = 5^6) Floor division (//): largest integer larger or equal to the division: 7//4 = 1. 75 (the largest integer is 1) 7//4 = -2 (the largest integer is -2) The remainder (%): also call modulo divide. # calculates pennies print( i have , dollars, and , cents, cents ) Result: i have 17 and 29 cents (dr. angela, powerpoint, slide #40) Functions are programming instructions for a specific task. Small set of functions already being set by default in python language and can be used without stating anything. E. g: abs() is function to return absolute value. (dr. angela, powerpoint, slide #46)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers