Skip to content

Instantly share code, notes, and snippets.

@linzino7
Created June 11, 2020 06:21
Show Gist options
  • Save linzino7/59946ca1fbcbeeccdd8a2de7a1d26816 to your computer and use it in GitHub Desktop.
Save linzino7/59946ca1fbcbeeccdd8a2de7a1d26816 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 11 12:22:10 2020
@author: Zino
"""
# 印出一列
for j in [1,2,3,4,5]:
print("*", end =" ")
# 印出兩列
for i in [1,2,3,4,5]:
for j in [1,2,3,4,5]:
print("*", end =" ")
print()
# 逐步執行
import time
for i in [1,2,3,4,5]:
print("i = "+str(i)+"|", end =" ")
for j in [1,2,3,4,5]:
print(str(j), end =" ")
time.sleep(1)
print( "換行" )
# 三角形
for i in range(1,6):
for j in range(1,i):
print("*", end =" ")
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment