Skip to content

Commit 265a0db

Browse files
committed
cp11
1 parent a96037b commit 265a0db

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

chapter11/a.test

Lines changed: 0 additions & 1 deletion
This file was deleted.

chapter11/practice/11_1/11_1.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
3+
__author__ = 'xy'
4+
5+
6+
def countToFour1():
7+
for eachNum in range(5):
8+
print(eachNum)
9+
10+
11+
def countToFour2(n):
12+
for eachNum in range(n, 5):
13+
print(eachNum)
14+
15+
16+
def countToFour3(n=1):
17+
for eachNum in range(n, 5):
18+
print(eachNum)
19+
20+
21+
a = 2
22+
b = 4
23+
c = 5
24+
25+
d = max(1,2,3)
26+
# countToFour1(a) error
27+
countToFour2(a)
28+
countToFour3(a)
29+
30+
# countToFour1(b) error
31+
countToFour2(b)
32+
countToFour3(b)
33+
34+
# countToFour1(c) error
35+
countToFour2(c)
36+
countToFour3(c)
37+
38+
countToFour1()
39+
# countToFour2() error
40+
countToFour3()

0 commit comments

Comments
 (0)