Basic Arithmetic
# Addition
Input :2+1
Output:3
# Subtraction
Input :2-1
Output:1
# Multiplication
Input :2*2
Output:4
# Division
Input :3/2
Output:1.5
# Floor Division
Input :7//4
Output:1
# Addition
Input :2+1
Output:3
# Subtraction
Input :2-1
Output:1
# Multiplication
Input :2*2
Output:4
# Division
Input :3/2
Output:1.5
# Floor Division
Input :7//4
Output:1
❤7👍4
Six Steps to Defining a Function
1. What should your function do? Type a couple of example calls.
2. Pick a meaningful name (often a verb or verb phrase): What is a short answer to "What does
your function do"?
3. Decide how many parameters the function takes and any return values
4. Describe what your function does and any parameters and return values in the docstring
5. Write the body of the function
6. Test your function. Think about edge cases.
1. What should your function do? Type a couple of example calls.
2. Pick a meaningful name (often a verb or verb phrase): What is a short answer to "What does
your function do"?
3. Decide how many parameters the function takes and any return values
4. Describe what your function does and any parameters and return values in the docstring
5. Write the body of the function
6. Test your function. Think about edge cases.
❤6👍1
❤8👍3
👍8😁6