Chapter 1
Chapter 1
Chapter 1
PROGRAMMING
Design
Correct
Write
Logic
Correct
Test
Syntax
# output: one*two
'False’,'None','True','and','as','assert','break','class',
'continue','def','del','elif','else','except','finally','for',
'from',
'global','if','import','in','is','lambda','nonlocal','not',
'or',
'pass','raise','return','try','while','with','yield'
dollars = 10000000.99
print (‘I have’, dollars, ‘in my
account’)
dollars = 9.99
print (‘Now I have’, dollars, ‘in my
account)
# welcome them!
print (‘Welcome,‘, username)
Addition +
Subtraction -
Multiplication *
Division (floating point) /
Division (integer) //
5+2
operator
- Subtraction
* Multiplication
/ Division
operand operand ** Exponent
% Remainder
// Floor division
answer = 5 + 2
print (‘the answer to 5 + 2 is’,
answer)
price = 100.00
sales_tax = 0.07