Question

Write a program using python that determines the distance to a lightning strike based on the...

Write a program using python that determines the distance to a lightning strike based on the time elapsed between the flash and the sound of thunder. The speed of sound is approximately 1120 ft/sec and 1 mile is 5280 ft.

You need to use a function for this program. It needs to take a single argument and return a single value.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code and output

Code for copying

t=int(input("ENter the time in seconds between the flash and thunder : "))
s=t*1120
print("The distance to a lightning strike is {} miles".format(s/5280))

Add a comment
Know the answer?
Add Answer to:
Write a program using python that determines the distance to a lightning strike based on the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • USING PYTHON IDLE 3.4: NEED HELP WITH THIS PLEASE! :( Question #8: You want to determine...

    USING PYTHON IDLE 3.4: NEED HELP WITH THIS PLEASE! :( Question #8: You want to determine the distance to lightning strikes during a storm. This can be measured using the time elapsed between seeing the lightning flash and hearing the thunder. You know that the speed of sound is approximately 1,100 ft/second and 1 mile is 5,280 feet. Write a program named q8.py that prompts the user for the number of lightning strikes to analyze and the number of seconds...

  • 3.44 Write a function distance that takes as input a number: the time elapsed (in sec-...

    3.44 Write a function distance that takes as input a number: the time elapsed (in sec- onds) between the flash and the sound of thunder. Your function should return the distance to the lightning strike in kilometers. The speed of sound is approximately 340.29 meters per second; there are 1000 meters in one kilometer. >>>distance (3) 1.0208700000000002

  • Distance from a lightning strike A general rule of thumb is that if you see lightning,...

    Distance from a lightning strike A general rule of thumb is that if you see lightning, there is one mile for every five seconds before the thunder is heard. Check this against the actual speed of sound Speed of sound at 20 C is approximately 343 m/s.

  • Use Python 3.7 to write the following program: Given a list of n numbers, write a...

    Use Python 3.7 to write the following program: Given a list of n numbers, write a function to shift the numbers circularly by some integer k (k < n). The function should take a list, the amount to shift k, and an argument specifying the direction to shift (left or right). Suggestion: use the % operation and also you need a number between 0 inclusive and the length of the list.

  • 1(a)    Write a python program using a function name slope(x1, y1, x2, y2) that returns...

    1(a)    Write a python program using a function name slope(x1, y1, x2, y2) that returns the slope of the line through the points (x1, y1) and (x2, y2). 1(b) For problem 1(a), write a python program using a function name Euclidean_dist(x1, y1, x2, y2) which will calculate and return the Euclidean distance between the points (x1, y1) and (x2, y2).

  • Write a Python program to create userids: You work for a small company that keeps the...

    Write a Python program to create userids: You work for a small company that keeps the following information about its clients: • first name • last name • a user code assigned by your company. The information is stored in a file clients.txt with the information for each client on one line (last name first), with commas between the parts. In the clients.txt file is: Jones, Sally,00345 Lin,Nenya,00548 Fule,A,00000 Your job is to create a program assign usernames for a...

  • program language: python 3 Purpose: Solve a problem by writing multiple functions that perform different subtasks,...

    program language: python 3 Purpose: Solve a problem by writing multiple functions that perform different subtasks, and combining their use to solve a larger problem. Also to practice documenting functions. Degree of Difficulty: Moderate Your task is to compute the cost of renovating the flooring in a rectangular room. This includes replacing the carpet and and the baseboards. Your task is to write a Python program that calculates and the cost of the renovation. To accomplish this, you will need...

  • Write a python program: using class named Example. it will accept a name, the content of...

    Write a python program: using class named Example. it will accept a name, the content of the file. we will use few functions to return the name of the file, owner, set date (time it was created the file), we can also add a line and delete a line from the file. another function that returns all the data in the file. and one that deletes any previous and sets any new data user enters. we can do like Test="a","this...

  • Your employer needs a program that analyzes the monthly sales figures for each division. Write a...

    Your employer needs a program that analyzes the monthly sales figures for each division. Write a Python program that allows the user to enter a series of numbers and places the numbers (not string values) in a list. Each number entered by the user is the monthly sales amount for one division. Use a sentinel-controlled loop to get input from the user and place each value entered into the list as long as the value is not negative. As soon...

  • I really need help with this python programming assignment Program Requirements For part 2, i need...

    I really need help with this python programming assignment Program Requirements For part 2, i need the following functions • get floats(): It take a single integer argument and returns a list of floats. where it was something like this def get_floats(n):   lst = []   for i in range(1,n+1):     val = float(input('Enter float '+str(i)+': '))     lst.append(val)   return lst • summer(): This non-void function takes a single list argument, and returns the sum of the list. However, it does not use...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT