Discuss / Python / 交作业。

交作业。

Topic source

# ! /usr/bin/env python3

# -*- coding:utf-8 -*-

def product(*nums):

    if len(nums)==0:

        raise TypeError( "No arguments were given !")

        #无参数

    s=1

    for num in nums:

        s*=num

    return s


  • 1

Reply