CSCA08H3 Lecture Notes - Lecture 2: Entire Function

71 views2 pages
20 Oct 2017
School
Course

Document Summary

Csca08 - lecture 02 - expressions, variables and functions. Python tries to resolve every expression into a value. Expressions can have sub-expressions, which can in turn have sub-sub expressions, etc. What is being stored and what we can do with the stored values. There are a few basic types that a value can have in python: String (just a special way of saying a line of text) No(cid:374)et(cid:455)pe (cid:894)a spe(cid:272)ial t(cid:455)pe for de(cid:374)oti(cid:374)g (cid:449)e do(cid:374)"t (cid:449)a(cid:374)t a(cid:374)(cid:455)thi(cid:374)g here(cid:895) Unlike other programming languages, python decides the types as you go. We can force python to change the type of something by casting it {treating a string as an integer or vice versa - ex: str(5)} We can find out the type of an expression using the type() function. So far, ea(cid:272)h ti(cid:373)e (cid:449)e"(cid:448)e e(cid:448)aluated so(cid:373)ethi(cid:374)g, (cid:449)e"(cid:448)e either pri(cid:374)ted it, or just thrown it away. We can store the result of an expression in a variable.

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