Checkpoint 25.1.1.
What will happen if you change the first line to remove the
int
function by making it numItems = input("How many items do you want?")
?- It runs the same
- Try it!
- It sometimes produces the wrong answer because it is comparing a string to a number
- Try it!
- There is an error because we are comparing a string to a number
- Correct. You are not allowed to compare a string to a number. Even if the string is something like "2" that looks like a number.