1.3.2. Lab#
Use this assignment to practice the chapter’s concepts and coding skills in runnable Python code.
Sign in from the account menu before you start working on the assignment.
Write and run your code directly in the coding cells.
Multiple submissions are allowed. The highest score is kept.
### Question 1: CRISP-DM phases
# A retail manager wants to predict which customers are likely to stop buying.
# Store the first three CRISP-DM phases in variables named phase_1, phase_2, and phase_3.
# Store the last three phases in variables named phase_4, phase_5, and phase_6.
# Then print the first phase and the last phase.
### Your code starts here.
### Your code ends here.
First phase: Business Understanding
Last phase: Deployment
### Question 2: Data science tool categories
# Create four variables named data_management_tool, data_manipulation_tool,
# data_analysis_tool, and data_visualization_tool.
# Give each variable one tool example from Section 1.1.
# Then print the visualization tool.
### Your code starts here.
### Your code ends here.
Visualization tool: Matplotlib
### Question 3: Decimal to binary conversion
# Convert the decimal number 13 to binary using base-2 place values.
# Store each binary digit in a variable named bit_3, bit_2, bit_1, and bit_0.
# Store the full binary answer in a variable named manual_binary.
# Then print manual_binary.
# Check your answer by printing bin(13).
decimal_number = 13
### Your code starts here.
### Your code ends here.
Manual conversion: 0b1101
Python check: 0b1101
### Question 4: Expressions and statements
# The values below describe one customer order.
# Write assignment statements that calculate subtotal, tax, and total.
# Then print all three values rounded to 2 decimal places.
# Use round(value, 2) to round a number to 2 decimal places.
unit_price = 18.75
quantity = 4
tax_rate = 0.0825
### Your code starts here.
### Your code ends here.
Subtotal: 75.0
Tax: 6.19
Total: 81.19
### Question 5: Number systems and character encoding
# A simple inventory system uses product code "C" and item number 64.
# Save the decimal code for "C" in c_decimal using ord().
# Save the binary representation of c_decimal in c_binary using bin().
# Save the hexadecimal representation of item_number in item_hex using hex().
# Print c_decimal, c_binary, and item_hex.
item_number = 64
### Your code starts here.
### Your code ends here.
C decimal: 67
C binary: 0b1000011
Item hex: 0x40
Question 1
Question 2
Question 3
Question 4
Question 5