W7_while_files - CSCA08/108 Week 7 while loops les 1...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCA08/108 Week 7 while loops, fles, 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Announcements A2 due in 18 days! By end of this week you should have Fnished to Step 5 at least! 2 2
Background image of page 2
Get it right! If you don't enter the correct password, you can't proceed: response = raw_input('Enter the password: ') if response != secret_code : response = raw_input( 'Enter the password: ' ) if response != secret_code : response = raw_input('Enter the password: ') if response != secret_code : response = raw_input('Enter the password: ') if response != secret_code : response = raw_input('Enter the password: ') if response != secret_code: response = raw_input('Enter the password: ') . . . . . Where will this go? 3 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
if, if, if, …. : while while (response != secret_code): response = raw_input('Enter the password: ') collect the if s that test the same condition under a while while = many if s (until we're satisfed) once the condition is False, we can put the thing behind us, and move on 4 4
Background image of page 4
while loops while /expression/: body # sequence of statements
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 14

W7_while_files - CSCA08/108 Week 7 while loops les 1...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online