Python Forum
How to solve this task?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to solve this task?
#3
Here is how you can determine the hours and years that the journey will take at a given speed entered as kilometers per hour.
LIGHT_SPEED = 1079252849 # kilometers per hour
HOURS_PER_YEAR = 8766

alphaCentauri = 4

kilometers_per_hour = int (input ("Введите скорость в километрах в час:"))
speed = kilometers_per_hour / LIGHT_SPEED
years = alphaCentauri / speed
hours = years * HOURS_PER_YEAR

print("время в часах:", hours ,"час(ов)")
print ("Время в годах:", years, "год(ы)")
Reply


Messages In This Thread
How to solve this task? - by DERO - Dec-06-2021, 04:33 PM
RE: How to solve this task? - by Gribouillis - Dec-06-2021, 06:32 PM
RE: How to solve this task? - by BashBedlam - Dec-06-2021, 07:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Stuck with using lists to solve task gery576 9 934 Jan-16-2024, 06:29 PM
Last Post: DPaul
  I need help to solve this task using while statement rico4pepe 6 9,307 Apr-02-2020, 11:34 AM
Last Post: pyzyx3qwerty

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020