Skip to content

Instantly share code, notes, and snippets.

@solen003
Created July 15, 2018 14:31
Show Gist options
  • Save solen003/a3cdbbb4fa73f27ee0964a8f26b5e16d to your computer and use it in GitHub Desktop.
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…
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