小编Mua*_*via的帖子

元组的连接

  1. 普通文字:

    • 我在python 3.2.1上编码时遇到了一些问题.其实我正在参加python 2.5上的在线讲座.
  2. 这是代码:

    x = 100
    divisors = ()
    for i in range(1,x):
        if x%i == 0:
            divisors = divisors + (i)
    
    Run Code Online (Sandbox Code Playgroud)
  3. 在运行程序时,出现以下错误:

    divisors = divisors + (i)  
    TypeError: can only concatenate tuple (not "int") to tuple
    
    Run Code Online (Sandbox Code Playgroud)

python tuples python-3.x

6
推荐指数
1
解决办法
5905
查看次数

标签 统计

python ×1

python-3.x ×1

tuples ×1