Question: Please if anyone can help me with these problems in ( python) hunderbolts When lightning strikes we see the fash before we hear the crash
hunderbolts When lightning strikes we see the fash before we hear the crash of thunder because light travels much faster than sound. You may assume the speed of sound is roughly 1100 feet per second and one milie ls 5280 feet Write a function called tind ightning_distance with a single parameter 'delay" which represents the delay between a liqhtninq strike and the corresponding thunder. The tunction should return the distance at which the Ightnino strike occurred In mlles Hint is there a formula that can be used to calculate distance (some kind of distance formula maybe)? Hint You should be able to write this function In less than 3 lines (maybe even one! so If you've written 20 llnes, you're overthinking It. Chess Values Chees pleces are commonly assigned values to provide a rough gulde to the state of play. Write a function called get plece value that takes In a sinqle parameter 'plece' and then retums the corresponding value. If the value passed to the function ls not a vaild chess plece, return None. The schema for determining the value of a chess plece is: - pawn 1 bishop: knight 3 rook 5 queen: Create a tunction caled number to word that takes In a single parameter that is an Integer and returns a string that contains the english words that correspond to that number In lowercase. You should verity that the number is positive and ls one or two diglts, Ir i is not, you should return None Sample run: number to word(42)-FOURTY TWO HInt: Don't forget the eens," they're a bit of a special case A company keeps phone numbers In two diterent formats but wants to standardize on one format Wrte a function caled 'standardize phone number that takes In one parameter called phone number. The phone number may be In one of the below formats or nelther of them. If the phone number ls In elther of the listed forms, the function should return the phone number In the second form. If It ls not In elther form, It should return None. Handling unexpected Input properly may be harder than you think The two styles you should conslder are: .(123) 456-7890 - 123-456-7890 HInt: strings have a method called str.lsdigit), you can read the docs here Hint: Don't forget that strings have a str.replaceo method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
