YYHDs 发表于 2021-6-22 17:51:46

最新版的python学习课后学习3

print("你好", name, sep=",", end="!")
sep=",", end="!"后面这点是什么意思

xiaosi4081 发表于 2021-6-22 17:51:47

sep是元素之间的分隔符

end是你输出完所有元素后要输出的内容

smog 发表于 2021-6-22 18:30:22

def print(self, *args, sep=' ', end='\n', file=None): # known special case of print
    """
    print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
   
    Prints the values to a stream, or to sys.stdout by default.
    Optional keyword arguments:
    file:a file-like object (stream); defaults to the current sys.stdout.
    sep:   string inserted between values, default a space.
    end:   string appended after the last value, default a newline.
    flush: whether to forcibly flush the stream.
    """
    pass

YYHDs 发表于 2021-6-22 18:37:42

smog 发表于 2021-6-22 18:30


谢谢啦{:5_95:}

LichengZhou 发表于 2021-6-22 21:09:46

受教了
页: [1]
查看完整版本: 最新版的python学习课后学习3