所以基本上我要做的就是从一组数字中取出第三个和第四个数字:
# Number Set
num_set = (28,54,79,37,2,9,0)
并将它们分开(79 和 37),这是我编写的代码:
# Division of third and fourth digits
# Seperating the digits
div_num = ((num_set[2,3]))
print("we are going to divide", div_num)
ans = (divmod(div_num))
print("the answer for 79 divide by 37 is", ans)
这给了我错误
“TypeError:元组索引必须是整数或切片,而不是元组”
任何帮助,将不胜感激 !谢谢