Created
September 26, 2017 16:25
-
-
Save blongho/6c3d9bd92ba5667132dd21110a4937d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def squares_in_range1(): | |
""" | |
Assumptions: | |
1. multiplication() function works well | |
2. in_range() function works well | |
Takes values and checks if the square of the number is in range (i.e btn 50 and 100) | |
Computes square using multiplication(num, num) | |
If in range, it gets the string, "Inside", otherwise "Outside" | |
""" | |
inside = "Inside," | |
outside = "Outside," | |
answer_str = "" | |
for num in range(4, 18): | |
if in_range(multiplication(num, num)): | |
answer_str += inside | |
else: | |
answer_str += outside | |
return answer_str[:-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment