def f(n):
print('i love python')
if n==1:return
return f(n-1)
n = int(input())
f(n)
我和我的好朋友、寶貝學生互動及學習使用Blogger的地方。
import sys
print('bool:',sys.getsizeof(True) )
print('char:',sys.getsizeof('a') )
print('short:',sys.getsizeof(1) )
print('int:',sys.getsizeof(65537) )
print('float:',sys.getsizeof(1048577) )
print('double:',sys.getsizeof(1.1) )
bool: 28↵\r\n
char: 42↵\r\n
short: 28↵\r\n
int: 28↵\r\n
float: 28↵\r\n
double: 24↵\r\n
#d = [[0,1],[1,2],[2,3],[3,4]] # no loop
d = [[0,1],[1,2],[2,3],[3,2]]
node = []
edge = []
for i in d:
node.append(i[0])
node.append(i[1])
edge.append([i[0],i[1]])
node = set(node)
#edge = set(edge)
links = []
for i in node:
t =str(i)
for j in edge:
if j[0]==i:
t = t + str(j[1])
links.append(t)
links1 = []
for i in links:
t = i
for j in edge:
if i[-1] == str(j[0]):
t = t + str(j[1])
links1.append(t)
links2 = []
for i in links1:
t = i
for j in edge:
if i[-1] == str(j[0]):
t = t + str(j[1])
links2.append(t)
for i in links2:
if len(list(i))!=len(set(i)):
print(i,':loop')