COMPSCI C8 Chapter 4: Computational & Inferential Thinking: Data Types
Document Summary
Two real number types: int : an integer of any size, float : a fractional number with limited size, never has a decimal point, 16- 17 significant figures, may be printed using scientific notation. : when performing a chain of many computations, use only the first. Advice from william kahan half of the precision of the result. String : a piece of text represented by a computer. Text can include numbers or truth values. Single and double quotes can both be used to create strings ( hi" and hi are identical) Double quotes allow you to include apostrophes inside strings. Expressions depend on both structure and type of values for meaning. Adding two strings together creates another string (e. g. data" + science" = datascience") str() : returns a string representations of any value. Str(1) has a value of 1 and returns 1". Str(1 +1) has an embedded value of 1 + 1 and returns 2".