#一、
#被2或者被3整除的正整数依次是:2,3,4,6,8,9,10,12,14,15,16,18...
#定义一个函数,求第n个被2或者被3整除的正整数是多少?
def getNum(dn):
var = 1
num = 1
while var >= 1:
if num % 2 == 0 and num % 3 == 0:
#print(num)
if var == int(dn):
print(num)
break
var += 1
num += 1
a = input('请输入第n个被2或者被3整除的正整数:')
getNum(a)
不解释了,感觉还是看代码清晰点