CP104 Lecture 12: Cp104 lesson 12
hayjayshay and 38575 others unlocked
2
CP104 Full Course Notes
Verified Note
2 documents
Document Summary
Computer languages use punctuation to: o indicate where a line of code ends o group lines of code together. Python uses very little punctuation: python groups lines of code together using indentation, used for control structures and functions, all lines in a control structure or function are indented by the same amount. Note: it is considered good programming style to use indentation even with punctuation heavy languages. 2) if condition is true, execute statements in body. 3) then continue with code that follows. Boolean expressions evaluate to true or false; boolean is a type like int, float, string. Work for number and strings: mixing number and string is unpredictable; not a good idea. Write a program to prompt for an employee"s salary, their sales amount and the sales target. For the month, if sales exceeds the target, add a bonus of to the salary.