Python Forum
Good Morning help simplify
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Good Morning help simplify
#2
The main this I see is that you don't need a, b, or c. You could just as easily calculate with the original values:

total1 = distance / mpg
total2 = ppg * total1
I would maybe rename those variables for clarity:

gallons_used = distance / mpg
total_cost = gallons_used * ppg
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Good Morning help simplify - by raymond2688 - Jul-17-2019, 01:43 PM
RE: Good Morning help simplify - by ichabod801 - Jul-17-2019, 02:01 PM
RE: Good Morning help simplify - by raymond2688 - Jul-17-2019, 02:40 PM
RE: Good Morning help simplify - by jefsummers - Jul-22-2019, 08:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simplify a program using functions nzieno 8 9,945 Oct-06-2016, 07:29 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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