A.sum(range(1,101))B.sum(range(0,101))C.sum(range(1,100))D.sum(range(0,100))
单项选择题在Python中,以下哪个语句用于判断一个数是否为偶数?()
A.if num %2==0B.if num %2!=0C.if num //2==0D.if num //2!=0
单项选择题在Python中,以下哪个语句用于判断一个数是否为正数?()
A.if num>0B.if num>=0C.if num<0D.if num<=0
单项选择题在Python中,以下哪个语句用于遍历元组的元素?()
A.for element in tupleB.for element in tuple.elements()C.for element in tuple.values()D.for element in tuple.items()
单项选择题在Python中,以下哪个语句用于遍历列表的元素?()
A.for element in listB.for element in list.elements()C.for element in list.values()D.for element in list.items()
单项选择题在Python中,以下哪个语句用于遍历字符串的字符?()
A.for char in stringB.for char in string.chars()C.for char in string.values()D.for char in string.items()