generate cubes of numbers
#solution : generate cubes of numbers def cubicvar(): i=1 while True: yield i*i*i i +=1 print("cubes of number") for num in cubicvar(): if num> 1000: break print(num) ======= RESTART: C:/python/generateCubesOfNUmber.py ==== cubes of number 1 8 27 64 125 216 343 512 729 1000 >>>
コメント
コメントを投稿