Quantcast
Channel: Microcontrollers, Programming and IoT
Viewing all articles
Browse latest Browse all 1271

Question on use of Python language

$
0
0
I enrolled in MIT's Intro to CS and Python Programming to help me better understand general computational thinking. I was 1/2 way through week 2 until I hit a snag that I haven't been able to pick apart. The for <> in <> loop has got me confused. Here is a sample:

iteration = 0
count = 0
while iteration < 5:
for letter in "hello, world":
count += 1
print "Iteration " + str(iteration) + "; count is: " + str(count)
iteration += 1

Iteration 0; count is: 12
Iteration 1; count...

Question on use of Python language

Viewing all articles
Browse latest Browse all 1271

Trending Articles