-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboolean_notes_starter.py
39 lines (27 loc) · 1.38 KB
/
boolean_notes_starter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# boolean values and logical operators
import random
# 2 BOOLEAN VALUES:
# in shell...
# a BOOLEAN EXPRESSION
# in shell...
# LOGICAL OPERATORS: and, or, not
# order of precendence is: not, and, or
# https://runestone.academy/runestone/static/thinkcspy/Selection/PrecedenceofOperators.html
# CHALLENGE: Generate a random number between 1 and 13 and
# print "Your number is lucky." if the number is 7, 11, or 13.
# CHALLENGE: Exclusive Network
'''
With a partner, write a Python program to grant access to an exclusive computer network.
- Get a username and password from the user
- Check to see if the username/password matches any of the exclusive member username/passwords
- Allow guest access if ‘guest’ is the username OR the password
- Print a message including the username if they gained access
- Print message denying access if the login credentials are incorrect
Extension challenges:
- Can you loop the program to allow the user to try entering the password again if they fail?
- Can you make the program only give them 3 opportunities to re-enter their password?
- Can you make the program check their password to be sure it's secure? (check for at least
8 characters, at least one numeric, and at least one special character (!, $, &) )
- What other features would an exclusive network have?
'''
input("Press enter to exit.")