CMPT 165 Chapter Notes - Chapter 9: Printf Format String

36 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+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