CMPT 165 Chapter Notes - Chapter 9: Printf Format String

37 views5 pages

Document Summary

In python (and other programming languages), you aren"t expected to do everything from scratch: some prepackaged functions come w/the language, int, str. So we have to import the modules we"re actually going to use: in the cgi module, there is a function named fieldstorage that we used to extract the cgi data. E. g. range between 1 to 10 import random print random. random(1,10) Making decisions: all of our programs so far have run straight from top to bottom, we need some way to implement conditional code. Code that only runs under certain circumstances. E. g. ask user for a password and display certain info only if the password they enter is correct: need 2 things: A way to express the condition (is the password correct?) A way to indicate which code runs only when the condition is true: first problem: expression conditions, conditions = written w/boolean expressions.

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