Based learning

  1. The digital output string function repr ():

    temp = 42
    print = "Hello," + repr(temp)

    Note: python3.0 before using back quotes `` achieve, but after they are no longer supported, such as:

    temp = 42
    print = "Hello," + `temp`

    Note: You can also use str () implementation principle is numeric type conversion. Str () function is used to translate the value suitable for human readable form, and the repr () for conversion to form read by the interpreter, used for development and debugging phase, https: //www.imooc.com/article/ 50568 detailed explanation:

    temp = 42
    print = "Hello," + str(temp)

Guess you like

Origin www.cnblogs.com/Sakurar/p/11622408.html