← Quiz: Refactoring with AI: all 10 questions
Quiz: Refactoring with AI · Question 7 of 10
Why keep integer arithmetic (// 100) in the refactor instead of switching to floats?
Why keep integer arithmetic (// 100) in the refactor instead of switching to floats?
- A.Floats are not allowed in Python 3
- B.Integers are always faster
- C.Float rounding could change some results by a rupee, which is a behaviour change
- D.The AI cannot write float code
Answer & explanation
Correct answer: Float rounding could change some results by a rupee, which is a behaviour change
Changing number types is a classic hidden behaviour change.
Can you get the rest right without peeking?
Take the timed Quiz: Refactoring with AI quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →