Python编程的一个作业
simple...
谁可以帮帮我,第一次注册知道,没什么分, 但一定会去赚分追加给最好的答案
我就不信你还去赚分来给我~~O(∩_∩)O
def cycle(a,i = 0):
____i += 1
____if a == 1:
________return i
____if a % 2 == 1:
________return cycle(a*3 + 1,i)
____else:
________return cycle(a/2,i)
def myprint(a,b):
____starstr = ""
____for i in range(b):
________starstr += "*"
____mystr = str(a) + ":" + starstr
____print mystr
def main():
____i = input("Please Enter a Value for i:")
____j = input("Please Enter a Value for j:")
____for t in range(i,j+1):
________myprint(t,cycle(t))
main()
多重随机标签