(sides)
| 25 | # Checks to make sure that the input is actually an integer. |
| 26 | # This implementation can be improved greatly of course. |
| 27 | def checkInput(sides): |
| 28 | try: |
| 29 | if int(sides) != 0: |
| 30 | if ( |
| 31 | float(sides) % int(sides) == 0 |
| 32 | ): # excludes the possibility of inputted floats being rounded. |
| 33 | return int(sides) |
| 34 | else: |
| 35 | return int(sides) |
| 36 | |
| 37 | except ValueError: |
| 38 | print("Invalid input!") |
| 39 | return None |
| 40 | |
| 41 | |
| 42 | # Picks a number that is at least of a certain size. |