Home > other >  Python - computing power input number N of 0 to 5 power as a result, the output and, in turn, these
Python - computing power input number N of 0 to 5 power as a result, the output and, in turn, these

Time:10-09

Computing power input number N of 0 to 5 power as a result, the output and, in turn, these six results, separated by a space between the output, including: N is an integer or floating point number,
N=input ()
Print (* * 1 * * 0 N, N, N * * 2, 3, N * * * * 4 N, N * * 5)
Consult a great god, and the code problem in where?

CodePudding user response:

N * * 1, it should be n * * 1

CodePudding user response:

# input () the default STR need to convert the format
N=float (input (" both please input a num: "))

Print (* * 1 * * 0 N, N, N * * 2, 3, N * * * * 4 N, N * * 5)

CodePudding user response:

refer to the second floor lalalala_CG response:
# input () the default STR need to convert the format
N=float (input (" both please input a num: "))

Print (* * 1 * * 0 N, N, N * * 2, 3, N * * * * 4 N, N * * 5)
thank you

CodePudding user response:

B=input ()
A=eval (b)
Print (a * * 0, a * * 1, 2, a * * a * * 3, 4 a * * and a * * 5)

CodePudding user response:

The import math
N=float (input ())
A=math.h ceil (N)
B=math.h floor (N)

If ((N==A) & amp; (N==B)) :

Print (A * * 0, A * * 1, 2, A * * A * * 3, 4 A * * and A * * 5)
The else:
Print (* * 1 * * 0 N, N, N * * 2, 3, N * * * * 4 N, N * * 5)


CodePudding user response:

N=input () the change to N=float (input ()), input () to collect your input and return the data type is a character, you want to use a float () conversion, converted to floating point

CodePudding user response:

reference 5 floor Zaria_z reply:
import math
N=float (input ())
A=math.h ceil (N)
B=math.h floor (N)

If ((N==A) & amp; (N==B)) :

Print (A * * 0, A * * 1, 2, A * * A * * 3, 4 A * * and A * * 5)
The else:
Print (* * 1 * * 0 N, N, N * * 2, 3, N * * * * 4 N, N * * 5)
hello, can I go into more detail about why do that? Found only N=float (input ()) through the evaluation, thank you ~ ~ Thanks? (? Omega?)?
  • Related