请用程序实现:找出元组 tuple_pre 中元素是 7 的倍数或个位为 7 的数,并将计算结果输出。
注意:元组 tuple_pre 已存在,可以直接使用 tuple_pre。
请在右侧编辑器中编写代码,完成练习。代码如下:
打印输出 tuple_pre
print(tuple_pre)
请计算元组 tuple_pre 中元素是7的倍数及个位为7的数,并将计算结果输出
for i in tuple_pre:
if i % 7 == 0:
print(i)
elif i % 10 == 7:
print(i)