ENGINEER 1D04 Chapter 3: chapter 3
scarletotter976 and 37168 others unlocked
4
ENGINEER 1D04 Full Course Notes
Verified Note
4 documents
Document Summary
Data: information that is stored and manipulated by computer program. Whole numbers are represented using the integer data type (int ), the values could be positive or negative. Numbers that can have a fractional parts are represented as a floating (float) Any long integer is represented as l as its last digit. Type function: tells us the data type of any value. The float type stores only approximations to real numbers, while (int) always have exact value. A library: is just a module that contains some useful definitions. To tell python that we are using the math module(library) the following line needs to be written at the top of the program import math. The general form when using a function from the math library. Four useful built- in functions(explicitly convert one data type into another: float () which converts the number to a float, ex. Float(1)=1. 0: round() which rounds a float to a nearest whole number , ex.