Python Forum
simple function problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
simple function problem
#6
def fruit(melon, pear):
    if melon > 10: return (melon*1000, pear*1500) # return total cost after discount
    return (melon*1000, pear*3000) # return total cost without discount
print(fruit(10, 5))
print(fruit(6, 4))
Reply


Messages In This Thread
simple function problem - by stereokim123 - Apr-25-2021, 03:22 PM
RE: simple function problem - by Yoriz - Apr-25-2021, 03:30 PM
RE: simple function problem - by raarkil - Apr-30-2021, 01:03 PM
RE: simple function problem - by Marbelous - May-03-2021, 03:21 PM
RE: simple function problem - by Kaaper - May-05-2021, 04:32 PM
RE: simple function problem - by naughtyCat - Aug-26-2021, 04:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple animation -- time evolution of function schniefen 0 1,058 Nov-20-2022, 08:05 PM
Last Post: schniefen
  I have a simple problem ahmed 5 2,597 Jul-17-2021, 02:50 PM
Last Post: ahmed
  Simple problem with functions and returns danlopek14q 10 6,910 Mar-17-2021, 05:32 PM
Last Post: danlopek14q
  Problem with a simple script Niko047 2 3,376 Jul-21-2017, 09:02 PM
Last Post: Niko047

Forum Jump:

User Panel Messages

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