小编Rub*_*ban的帖子

有人可以解释在此Python程序中*的用法吗?

if __name__ == '__main__':
    n = int(input())
    student_marks = {}
    for _ in range(n):
        name, *line = input().split()
        scores = list(map(float, line))
        student_marks[name] = scores
    query_name = input()
Run Code Online (Sandbox Code Playgroud)

有人可以*在上面的Python代码段中解释的用法吗?

python dictionary python-3.x

2
推荐指数
1
解决办法
62
查看次数

为什么我们在调用一些函数时放 () 而有些我们在 python 中没有?

df.shape #we check the shape of dataset
(1338, 7)
Run Code Online (Sandbox Code Playgroud)

在调用上述形状函数时,我们没有使用 (),但对于大多数其他函数,我们使用 ()。这是为什么?

df.info()# gives the info of the dataset 
Run Code Online (Sandbox Code Playgroud)

python function function-call python-3.x

-1
推荐指数
1
解决办法
42
查看次数

标签 统计

python ×2

python-3.x ×2

dictionary ×1

function ×1

function-call ×1