Last active
November 13, 2017 20:58
-
-
Save Basanites/7b086a55f8a01ef53b9ea082615a3f1e to your computer and use it in GitHub Desktop.
Physics assignment solution
This file contains hidden or 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
| import math | |
| g = 9.81 | |
| m = 1.0 | |
| v = g * math.sqrt(2 / g) | |
| def blast(n): | |
| if n == 1: | |
| return v | |
| else: | |
| return (2 * (m / math.pow(10, n - 2)) * blast(n - 1) - (m / math.pow(10, n - 1)) * v + ( | |
| m / math.pow(10, n - 2)) * v) / ((m / math.pow(10, n - 2)) + (m / math.pow(10, n - 1))) | |
| x = 2 | |
| while (blast (x) < 11200): | |
| x += 1 | |
| print("\n", blast(x), "\n", x, "\n\n", blast(x-1), "\n", x - 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment