COMPSCI 1MD3 Lecture 4: Aspects of Programming Languages - Python Semantics & Syntax

34 views3 pages

Document Summary

Python: literals (e. g. , the number 3. 2 and the string abc or 123 ) and operators (e. g. , + and /) English: it defines which strings of words constitute well-formed sentences. English: it defines which sentences are meaningful. I are hungry" -syntactically valid but static semantic error. Python: it decides which syntactically valid strings have a meaning. 3 + hi -syntactically valid but static semantic error. English: it defines the meaning of those sentences. I cannot praise this student too highly, -can be ambiguous. Python: it associates a meaning with each syntactically correct string of symbols that has no static semantic errors. 3 + 2 have only one meaning. Objects have a type that defines the kinds of things programs can do to them. Bool represent boolean values true and false. None special and has one value, none. To find the type of an object, use type(). Can convert object of one type to another.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents