Skip to content

Commit 8a72b58

Browse files
committed
minor fixes
1 parent 77e0f2d commit 8a72b58

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

01_Day_Introduction/helloworld.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
print(type('Asabeneh')) # String
1818
print(type([1, 2, 3])) # List
1919
print(type({'name':'Asabeneh'})) # Dictionary
20-
print(type({9.8, 3.14, 2.7})) # Tuple
20+
print(type({9.8, 3.14, 2.7})) # Set
21+
print(type((9.8, 3.14, 2.7))) # Tuple

04_Day_Strings/04_strings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ print(challenge.index(sub_string, 9)) # error
373373
```py
374374
challenge = 'thirty days of python'
375375
sub_string = 'da'
376-
print(challenge.index(sub_string)) # 8
377-
print(challenge.index(sub_string, 9)) # error
376+
print(challenge.rindex(sub_string)) # 8
377+
print(challenge.rindex(sub_string, 9)) # error
378378
```
379379

380380
- isalnum(): Checks alphanumeric character

05_Day_Lists/day_5.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
print(fruits) # ['avocado', 'orange', 'mango', 'lemon']
5959
fruits[1] = 'apple'
6060
print(fruits) # ['avocado', 'apple', 'mango', 'lemon']
61-
last_index = len(fruits)
61+
last_index = len(fruits) - 1
6262
fruits[last_index] = 'lime'
6363
print(fruits) # ['avocado', 'apple', 'mango', 'lime']
6464

@@ -80,7 +80,7 @@
8080
fruits = ['banana', 'orange', 'mango', 'lemon']
8181
fruits.insert(2, 'apple') # insert apple between orange and mango
8282
print(fruits) # ['banana', 'orange', 'apple', 'mango', 'lemon']
83-
fruits.list(3, 'lime') # ['banana', 'orange', 'apple', 'mango', 'lime','lemon',]
83+
fruits.insert(3, 'lime') # ['banana', 'orange', 'apple', 'mango', 'lime','lemon',]
8484
print(fruits)
8585

8686
# remove
@@ -92,10 +92,10 @@
9292

9393
# pop
9494
fruits = ['banana', 'orange', 'mango', 'lemon']
95-
fruits.remove()
95+
fruits.pop()
9696
print(fruits) # ['banana', 'orange', 'mango']
9797

98-
fruits.remove(0)
98+
fruits.pop(0)
9999
print(fruits) # ['orange', 'mango']
100100

101101
# del
@@ -161,10 +161,10 @@
161161
# Reverse
162162
fruits = ['banana', 'orange', 'mango', 'lemon']
163163
fruits.reverse()
164-
print(fruits.reverse())
164+
print(fruits)
165165
ages = [22, 19, 24, 25, 26, 24, 25, 24]
166166
ages.reverse()
167-
print(ages.reverse())
167+
print(ages)
168168

169169
# sort
170170
fruits = ['banana', 'orange', 'mango', 'lemon']

08_Day_Dictionaries/08_dictionaries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ person = {
6161
'age':250,
6262
'country':'Finland',
6363
'is_marred':True,
64-
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python']
64+
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python'],
6565
'address':{
6666
'street':'Space street',
6767
'zipcode':'02210'

12_Day_Modules/12_modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,15 @@ print(randint(5, 20)) # it returns a random integer number between [5, 20] inclu
259259
2. Modify the previous task. Declare a function named user_id_gen_by_user. It doesn’t take any parameters but it takes two inputs using input(). One of the inputs is the number of characters and the second input is the number of IDs which are supposed to be generated.
260260

261261
```py
262-
user_id_gen_by_user() # user input: 5 5
262+
print(user_id_gen_by_user()) # user input: 5 5
263263
#output:
264264
#kcsy2
265265
#SMFYb
266266
#bWmeq
267267
#ZXOYh
268268
#2Rgxf
269269

270-
user_id_gen_by_user() # 16 5
270+
print(user_id_gen_by_user()) # 16 5
271271
#1GCSgPLMaBAVQZ26
272272
#YD7eFwNQKNs7qXaT
273273
#ycArC5yrRupyG00S

0 commit comments

Comments
 (0)