|
5311 | 5311 | "step":"same_list" |
5312 | 5312 | }, |
5313 | 5313 | { |
5314 | | -"page":"Nested Loops", |
| 5314 | +"page":"IntroducingNested Loops", |
5315 | 5315 | "program": [ |
5316 | 5316 | "for letter in\"ABC\":", |
5317 | 5317 | " print(letter)", |
|
5460 | 5460 | "step":"first_nested_loop" |
5461 | 5461 | }, |
5462 | 5462 | { |
5463 | | -"page":"Nested Loops", |
| 5463 | +"page":"IntroducingNested Loops", |
5464 | 5464 | "program": [ |
5465 | 5465 | "for letter in\"ABC\":", |
5466 | 5466 | " print(letter)", |
|
5634 | 5634 | "step":"first_nested_loop_with_line" |
5635 | 5635 | }, |
5636 | 5636 | { |
5637 | | -"page":"Nested Loops", |
| 5637 | +"page":"IntroducingNested Loops", |
5638 | 5638 | "program": [ |
5639 | 5639 | "for letter in\"ABC\":", |
5640 | 5640 | " print(letter)", |
|
5915 | 5915 | "step":"first_nested_loop_with_two_arg_print" |
5916 | 5916 | }, |
5917 | 5917 | { |
5918 | | -"page":"Nested Loops", |
| 5918 | +"page":"IntroducingNested Loops", |
5919 | 5919 | "program": [ |
5920 | 5920 | "print(1 +\"x\")" |
5921 | 5921 | ], |
|
5968 | 5968 | "step":"times_table_exercise" |
5969 | 5969 | }, |
5970 | 5970 | { |
5971 | | -"page":"Nested Loops", |
| 5971 | +"page":"IntroducingNested Loops", |
5972 | 5972 | "program": [ |
5973 | 5973 | "for left in range(12):", |
5974 | 5974 | " left += 1", |
|
9571 | 9571 | "step":"times_table_exercise" |
9572 | 9572 | }, |
9573 | 9573 | { |
9574 | | -"page":"Nested Loops", |
| 9574 | +"page":"IntroducingNested Loops", |
9575 | 9575 | "program": [ |
9576 | 9576 | "2 x 3" |
9577 | 9577 | ], |
|
9628 | 9628 | "step":"times_table_exercise" |
9629 | 9629 | }, |
9630 | 9630 | { |
9631 | | -"page":"Nested Loops", |
| 9631 | +"page":"IntroducingNested Loops", |
9632 | 9632 | "program": [ |
9633 | 9633 | "for left in range(12):", |
9634 | 9634 | " left += 1", |
|
15519 | 15519 | "step":"times_table_exercise" |
15520 | 15520 | }, |
15521 | 15521 | { |
15522 | | -"page":"Nested Loops", |
| 15522 | +"page":"IntroducingNested Loops", |
15523 | 15523 | "program": [ |
15524 | 15524 | "players = ['Alice', 'Bob', 'Charlie']", |
15525 | 15525 | "for player1 in players:", |
|
15703 | 15703 | "step":"player_vs_player_exercise" |
15704 | 15704 | }, |
15705 | 15705 | { |
15706 | | -"page":"Nested Loops", |
| 15706 | +"page":"IntroducingNested Loops", |
15707 | 15707 | "program": [ |
15708 | 15708 | "letters = 'AB'", |
15709 | 15709 | "for c1 in letters:", |
|
15858 | 15858 | "<p>Building up a line of characters should be very familiar from previous exercises, the only difference is that you have to make it a given length instead of just the same length as another string.</p>", |
15859 | 15859 | "<p>An easy way to do something <code>n</code> times is to loop over <code>range(n)</code>. </p>", |
15860 | 15860 | "<p>You need to use a for loop inside a for loop.</p>", |
15861 | | -"<p>You need numbers that count down, like 5, 4, 3, 2, 1. There is a way to do this with range, and you can easily look it up, but it's also easy to use a normal range and do some very simple maths to convert numbers counting up into numbers counting down.</p>", |
| 15861 | +"<p>You need numbers that count down, like 5, 4, 3, 2, 1. There is a way to do this with<code>range</code>, and you can easily look it up, but it's also easy to use a normal range and do some very simple maths to convert numbers counting up into numbers counting down.</p>", |
15862 | 15862 | "<p>What formula converts 0 into 5, 1 into 4, 2, into 3, etc?</p>" |
15863 | 15863 | ], |
15864 | 15864 | "page_index":29, |
|
15872 | 15872 | "step":"crack_password_exercise" |
15873 | 15873 | }, |
15874 | 15874 | { |
15875 | | -"page":"Nested Loops", |
| 15875 | +"page":"IntroducingNested Loops", |
15876 | 15876 | "program": [ |
15877 | 15877 | "size = 3", |
15878 | 15878 | "for i in range(size):", |
|