CMPT 165 Chapter Notes - Chapter 9: Passwd

35 views4 pages

Document Summary

In modern programming languages, there are so many functions for common tasks provided, that it doesn"t make sense to have all of them available all the time: many of the provided functions are separated into libraries. Since the function is in the cgi module, we used it by calling cgi. fieldstorage(: to call a function in a module, we first import the module. These can be used to introduce an element of chance into a game: it contains a function named random that returns a random number between 0 and 1 (possibly including 0, but never 1). For example: import random print random. random(: see online reference for more python modules. 9. 2 making decisions: conditional code code that only runs under certain circumstances, example: we might want to ask the user for a password, and display certain information only if the password they enter is correct. != not equal to: so, each of these expressions evaluates to a boolean value.

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