-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLec02.py
More file actions
65 lines (59 loc) · 1.11 KB
/
Copy pathLec02.py
File metadata and controls
65 lines (59 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# MIT600《计算机科学及编程导论》(2008年秋季)样码
# 第二讲:分支、条件和循环
# 翻译制作:ocourse.org
# 课程讨论版:http://ocourse.org/bbs/forum.php?mod=forumdisplay&fid=29
# by yoeo24
##x = 3 # 创建变量x,并赋值为3
##x=x*x # 赋值9给x
##print x
##n = raw_input('输入一个数字:')
##print n
### print n/n
##
##x = input('输入一个数字:')
##if not x%2:
#### print '偶数'
##else: print '奇数'
##x = 15
##if (x/2)*2 == x: print '偶数'
##else: print '奇数'
##
##z = 'b'
####if 'x'<z:
#### print 'Hello'
#### print 'Mom'
##if 'x'<z:
## print 'Hello'
##print 'Mom'
##
##x = 15
##y = 13
##z = 11
##print x,y,z
### 这里正确吗?
####if x < y:
#### if x < z: print 'x最小'
#### else: print 'z最小'
####else: print 'y最小'
##
##if x<y and x<z: print 'x最小'
##elif y<z: print 'y最小'
##else: print 'z最小'
##y = 0
##x = 3
##itersLeft = x
##while(itersLeft>0):
## y = y + x
## itersLeft = itersLeft - 1
## print 'y=',y,',itersLeft',itersLeft
##print y
##x = 10
##i = 1
##while(i<x):
## if x%i == 0:
## print '约数',i
## i = i+1
x = 10
for i in range(1,x):
if x%i == 0:
print '约数',i