Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] - Comparing int and float gives wrong answer (hedyorg#3948)
## Description * `convert_numerals` function now returns an int, float or string accordingly * no longer necessary to pad with leading zeros Fixes hedyorg#3726 ## How to test ### Automated Unit test: ``` python -m pytest tests/test_level/test_level_14.py -k 'test_greater_than_with_int_and_float or test_not_greater_than_with_int_and_float' ``` ### Manual UI test: 1. reproduce bad behavior 2. apply fix 3. confirm corrected behavior #### To reproduce the broken behavior, before this fix is applied: Navigate to Level 14, enter and run the following code: ``` age = 16 if age > 15.0 print 'You are older than me!' else print 'You are younger than me!' age = 7.0 if age > 15 print 'You are older than me!' else print 'You are younger than me!' ``` expected output ``` You are older than me! You are younger than me! ``` actual output ☹ ``` You are younger than me! You are older than me! ``` #### To confirm fix after it has been applied: Execute the reproduction steps above, and confirm that now the expected output matches the actual output 😃
- Loading branch information