ECS 32A Lecture Notes - Lecture 2: Newline, Ascii Art

124 views2 pages
Verified Note

Document Summary

Output is important bc it allows python scripts to interact with other programs. Python uses the print() function to print information to the console. Single or double quotes can be used; as long as they are the same. Print() automatically ends in a newline, but you can change that with named parameter end= Is the special character with a tab. To add comments, use the # character. To get input from the user, use the input() function. To convert a string to an integer, use the int() function. Occurs when variable is not declared beforehand. The computer doesn"t know what the variable is. Occurs when there is a mismatch of the tpe between two variables. I. e. adding an int to a string. Will result in a type error bc num_pizza is a string as denoted by the quotes. Occurs when the syntax is not correct. Occurs when the interpreter crashes; it doesn"t know what to do.

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