ECS 32A Study Guide - Final Guide: Allen & Unwin, 18 Months, Newline

105 views16 pages
orangeserval529 and 8 others unlocked
ECS 32A Full Course Notes
55
ECS 32A Full Course Notes
Verified Note
55 documents

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= To get input from the user, use the input() function. Example: print( hello world ) num_pizza = input( how many pizzas?\n ) Occurs when the syntax is not correct. Occurs when the interpreter crashes; it doesn"t know what to do. The program works, but the results are wrong. Modern computers are based on voltage levels, either on or off. The reason there are only two levels is bc it is more efficient that way. More voltage levels requires more current which produces more heat which is not as efficient. Computers store and interact with data in bits. A bit is a binary digit: either 0 or 1.