Created
July 15, 2018 14:31
-
-
Save solen003/a3cdbbb4fa73f27ee0964a8f26b5e16d to your computer and use it in GitHub Desktop.
Write a program that calculates and prints the value according to the given formula: Q = Square root of [(2 * C * D)/H] Following are the fixed values of C and H: C is 50. H is 30. D is the variable whose values should be input to your program in a comma-separated sequence. Example Let us assume the following comma separated input sequence is gi…
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
import math | |
numbers = input("Provide D: ") | |
numbers = numbers.split(',') | |
result_list = [] | |
for D in numbers: | |
Q = round(math.sqrt(2 * 50 * int(D) / 30)) | |
result_list.append(Q) | |
print(result_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment