I&C SCI 31 Lecture Notes - Lecture 2: Programming Language

37 views2 pages

Document Summary

Get input from user in python shell. Don"t have to declare variable type before declaring the variable like in java, python figures it out. The syntax of a print statement (technically, a call to the function named print") is print( list_of_arguments ) The semantics of a print statement are: print out the value of each argument in the list. Make the right on the right, the thing on the left, assign right to left. Evaluate the expression and bind/assign/associate its value with the name on the left side. Variables username is not the same as username. # (statement) - have to type pound sign for each line. We use them to delimit character strings. A = hello, what"s your name? works. B = hello, what"s your name?" error message because the apostrophe in what"s" ends the string. B = hello, what\"s your name?" works, putting a backslash escapes the apostrophe, tells python this is not the end of the string.

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

Related Questions