Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 2

215 bytes added, 07:22, 26 May 2017
PART 1 - Using IF Statements
print('This second print statement will also not run')
print('This print statement will run')
</source>What do you notice?<br><br>:#These if statements are So far, you have been using boolean logic, this means they are either only the '''Boolean values True or False''' for your IF statements. The above code uses if statement that are ALWAYS setAlthough this can be useful, next lets makes it can be more practical to state a condition to test in order to render a if '''True''' or '''False''' Boolean value to be used with control flow statements (referred to as: '''Boolean Logic''').<br><br>:#let's create an IF statement that runs under specific conditions.Issue the following code below:<source>
password = input('Please enter a secret password')
if password == 'P@ssw0rd':
13,420
edits