Chapter 4: Problem 7
Write an if statement that assigns 0.2 to commissionRate if sales is greater than or equal to 10000 .
Short Answer
Expert verified
Question: Given sales of 12000, write an if statement to assign a commission rate of 0.2 if sales are equal to or greater than 10000.
Answer:
```python
sales = 12000
commissionRate = 0
if sales >= 10000:
commissionRate = 0.2
print("commissionRate:", commissionRate)
```
In this code, the provided if statement checks if sales are greater than or equal to 10000, and assigns a commission rate of 0.2 when the condition is met. The final printed output will display "commissionRate: 0.2".
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.