Skip to content

Commit d1dd22c

Browse files
authored
Merge branch 'master' into master
2 parents bab4b8f + f2969bc commit d1dd22c

File tree

6 files changed

+39
-23
lines changed

6 files changed

+39
-23
lines changed

.gitpod.Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
2-
31
FROM gitpod/workspace-full:latest
42

53
USER gitpod
64

75
RUN pip3 install pytest==4.4.2 pytest-testdox && npm i breathecode-cli@1.1.81 -g
6+

.gitpod.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ ports:
77
tasks:
88
- command: >
99
bc run:exercises -e=gitpod;
10-
github:
11-
prebuilds:
12-
# enable for the master/default branch (defaults to true)
13-
master: true
14-
# enable for pull requests coming from this repo (defaults to true)
15-
pullRequests: false
16-
# add a "Review in Gitpod" button as a comment to pull requests (defaults to true)
17-
addComment: false
10+
# github:
11+
# prebuilds:
12+
# # enable for the master/default branch (defaults to true)
13+
# master: true
14+
# # enable for pull requests coming from this repo (defaults to true)
15+
# pullRequests: false
16+
# # add a "Review in Gitpod" button as a comment to pull requests (defaults to true)
17+
# addComment: false
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `01.3` Print the last one
22

3-
You will never know how many `items` my_stupid_list has because it is being `randomly` generated during runtime.
3+
You will never know how many `items` my_stupid_list has, because it is being `randomly` generated during runtime!
44

55
You know that the property:
66
```py
@@ -10,12 +10,12 @@ len(name_list) function
1010
returns the `length of` name_list .
1111

1212
## 📝 Instructions
13-
1. Create a variable named the_last_one, and assign it the LAST element of my_stupid_list.
14-
2. Then, print it on the console.
15-
13+
1. import random function at the beginning of the file
14+
2. Create a variable named the_last_one, and assign it the LAST element of my_stupid_list.
15+
3. Print the_last_one to the console.
1616

1717
💡Hint:
1818
```py
19-
-Remember import random function
20-
-Ask to Google How import random in python?
21-
```
19+
- to use the random functionality, we must import. The most effective way is by using "import random", without the quotes, at the beginning of the document. For more information about importing, check out the Python documentation: https://docs.python.org/3/reference/import.html?highlight=importing.
20+
- In Python, remember we can access the first element in a list by using my_list_name[0], the second with my_list_name[1] and so on. To access items starting at the *end* of the list, we can use negative values starting from my_list_name[-1] (there is no [-0]). For more check out: https://docs.python.org/3/tutorial/introduction.html.
21+
```
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#Remember import random function here:
2-
import random
32

43
my_list = [4,5,734,43,45]
54

65
#The magic is here:
7-

exercises/01.5-loop-seventeen/README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
# `01.5` Loop from 1 to 17
22

3-
# 📝Instructions from your teacher:
4-
1. Count from 1 to 17 with a loop and print each number on the console.
3+
To loop a specific number of times, we can use range(). In Python, range() returns a sequence of numbers starting with 0, incrementing by 1 each time until it reaches the range.
4+
5+
range() function example:
6+
7+
for x in range(5):
8+
print(x)
9+
10+
expected output:
11+
0
12+
1
13+
2
14+
3
15+
4
516

17+
Note that the number specified in range(), 5 in this example, is never reached and 4 is our last output. We can incorporate additional parameters to further specify (now could be a good time to google or at least check the HINT section ;) ).
618

19+
# 📝Instructions from your teacher:
20+
1. Count from 1 to 17 with a loop and print each number on the console.
721

822
💡HINT:
923
1. This how you loop
@@ -28,4 +42,4 @@ Expected console result:
2842
15
2943
16
3044
17
31-
```
45+
```
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
my_sample_list = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12]
22

3-
#The magic pass below:
3+
# The magic pass below:
4+
# Create a variable, like "i", that uses the last index position in the array "my_sample_list". Remember we can access the length property of an array using len, and that the position will always be 1 less than the item number (item one is index 0, item 5653 would be one less...)
45

6+
# You can now use the variable holding the last position to iterate until you get to the first position- which will always be 0. Create a for loop using that variable, make sure the value of the variable is modified on each iteration of the loop.
7+
# while some_variable_reference > 0:
8+
# print(my_sample_list[some_variable_reference])
9+
# chage after doing what we wanted, change the variables value so that the next pass it references the new index position

0 commit comments

Comments
 (0)