AnasHowlader / Programming-Challenges

Miscellaneous programming challenges
GNU General Public License v3.0
0 stars 0 forks source link

Efficiency #3

Closed ecoppen closed 2 years ago

ecoppen commented 2 years ago

why-waste-time-when-few-word-do-trick

https://github.com/AnasHowlader/Programming-Challenges/blob/eee1be11555b862145670ea1fd2d9f79184fbe73/Brampton%20Manor%20Academy/Programming%20Challenge%202/Richter.py#L5-L21

 def tons_of_tnt(richter_value): 
     return float((magnitude(richter_value))/(4.184*10**9)) 

https://github.com/AnasHowlader/Programming-Challenges/blob/eee1be11555b862145670ea1fd2d9f79184fbe73/Brampton%20Manor%20Academy/Programming%20Challenge%202/Richter.py#L43-L47

values = [1,5,9.1,9.2,9.5]
for value in values:
    print(f"Energy released for a magnitude of {value}: {magnitude(value)/(4.184*10**9)} Joules")
AnasHowlader commented 2 years ago

@ecoppen Sir for challenge 13 im stuck on how to loop so it gives me the position numbers 1 -10

ecoppen commented 2 years ago

This is an issue for a different piece of code, if it’s done close it and make a new issue for the other code.