Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function help
#1
this might be a dumb question but i have this function can i set what i want it to return using a variable.

for example if i call my minute_ function i set x = 2 can i have another variable indicating what i want it to return.

i want to return either minute = x * second()or min_as_second = m * second() depending on the situation.

im just trying to avoid if statements or is that the only way?

def minute_(x):
    m = second() * 60  # = 60
    minute = x * second()
    min_as_second = m * second()
    return min_as_second
Reply


Messages In This Thread
function help - by Nickd12 - Nov-06-2020, 09:39 PM
RE: function help - by Gribouillis - Nov-06-2020, 09:56 PM
RE: function help - by jefsummers - Nov-07-2020, 07:35 PM
RE: function help - by Nickd12 - Nov-08-2020, 01:44 AM
RE: function help - by bowlofred - Nov-08-2020, 04:23 AM
RE: function help - by Gribouillis - Nov-08-2020, 07:32 AM

Forum Jump:

User Panel Messages

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