Home > other >  Implement any number of multi () function, parameters, and returns the product of all parameters.
Implement any number of multi () function, parameters, and returns the product of all parameters.

Time:10-28

Def multi () : l=list (map (int, input (" please enter the number use commas: "). The split (", "))) x=len (l) c=1 for I in range (x) : c=c * l [I] print (" product for {: 2 f} : ". The format (c))
Multi ()

If the input is an integer can correct operation, but I want to input a integer and floating point Numbers or plural how to modify the program, the great god, please give directions!

CodePudding user response:

Amend the int to float
LST=list (map (float, input (" please enter the number use commas: "). The split (', ')))

CodePudding user response:

reference 1/f, brother huang Python training response:
amend the int to float
LST=list (map (float, input (" please enter the number use commas: "). The split (', ')))
that if I want to enter both the integer and floating point Numbers are plural

CodePudding user response:

According to below to do this, you can write a function return value as an integer, floating point Numbers or all of the plural list,
To improve the modified yourself

CodePudding user response:

yellow elder brother Python training reference 3 floor response:
according to the following to do this, you to write a function return value as an integer, floating point Numbers or all of the plural list,
To improve the modified yourself
yes thank you please ask your use of this software which can tell me the name of? Thank you

CodePudding user response:

The
H& reference 4 floor; W reply:
Quote: brother huang Python training reference 3 floor response:
according to the following to do this, you to write a function return value as an integer, floating point Numbers or all of the plural list,
To improve the modified yourself
yes thank you please ask your use of this software which can tell me the name of yao thank you




Using a Sublime does Text 3

CodePudding user response:

yellow elder brother Python training reference 5 floor response:
Quote: refer to 4th floor H& W reply:

Quote: brother huang Python training reference 3 floor response:
according to the following to do this, you to write a function return value as an integer, floating point Numbers or all of the plural list,
To improve the modified yourself
yes thank you please ask your use of this software which can tell me the name of yao thank you




With Sublime does Text 3
installed Sublime does trouble ask me now how can want to python IDLE 3 F5 to run and then input value can return results thank you god

CodePudding user response:

To search Sublime does text how to run a python

Under general is CTRL + b or MAC command + b

CodePudding user response:

yellow elder brother Python training reference 7 floor response:
to search Sublime does text how to run a Python

Under general is CTRL + b or MAC command + b
but can't return results can be run after the input

CodePudding user response:

Sublime does the text does not support the input () if you want to support the input () function, you need to install the plugin, please to search for,

CodePudding user response:

Thank you very much careful interpretation

CodePudding user response:

Use eval (bai)?

CodePudding user response:

references 9/f, brother huang Python training response:
Sublime does the text does not support the input () if you want to support the input () function, need to install the plugin, please to search,
great god sublimerepl configured points Python - RUN the current file after commissioning finished the input program input enter prompt repl closed
  • Related