Program to find the Speed of train as per speed of sound | Python3 implementation of the approach ; Function to find the Speed of train ; Driver code ; calling Function
from math import ceil NEW_LINE def speedOfTrain ( X , Y ) : NEW_LINE INDENT Speed = 0 NEW_LINE Speed = 1188 * ( ( X - Y ) / Y ) NEW_LINE return Speed NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT X = 8 NEW_LINE Y = 7.2 NEW_LINE print ( ceil ( speedOfTrain ( X , Y ) ) , end = " ▁ km / hr " ) NEW_LINE DEDENT