COMPSCI C8 Chapter 4: Computational & Inferential Thinking: Data Types

50 views5 pages
2 Mar 2017
School
Professor

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".

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

Related Documents