A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
2
Task/Loops-Foreach/Python/loops-foreach-1.py
Normal file
2
Task/Loops-Foreach/Python/loops-foreach-1.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
for i in collection:
|
||||
print i
|
||||
10
Task/Loops-Foreach/Python/loops-foreach-2.py
Normal file
10
Task/Loops-Foreach/Python/loops-foreach-2.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
lines = words = characters = 0
|
||||
f = open('somefile','r')
|
||||
for eachline in f:
|
||||
lines += 1
|
||||
for eachword in eachline.split():
|
||||
words += 1
|
||||
for eachchar in eachword:
|
||||
chracters += 1
|
||||
|
||||
print lines, words, characters
|
||||
Loading…
Add table
Add a link
Reference in a new issue