Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Asabeneh committed Jul 10, 2021
1 parent 77e0f2d commit 8a72b58
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion 01_Day_Introduction/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
print(type('Asabeneh')) # String
print(type([1, 2, 3])) # List
print(type({'name':'Asabeneh'})) # Dictionary
print(type({9.8, 3.14, 2.7})) # Tuple
print(type({9.8, 3.14, 2.7})) # Set
print(type((9.8, 3.14, 2.7))) # Tuple
4 changes: 2 additions & 2 deletions 04_Day_Strings/04_strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ print(challenge.index(sub_string, 9)) # error
```py
challenge = 'thirty days of python'
sub_string = 'da'
print(challenge.index(sub_string)) # 8
print(challenge.index(sub_string, 9)) # error
print(challenge.rindex(sub_string)) # 8
print(challenge.rindex(sub_string, 9)) # error
```

- isalnum(): Checks alphanumeric character
Expand Down
12 changes: 6 additions & 6 deletions 05_Day_Lists/day_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
print(fruits) # ['avocado', 'orange', 'mango', 'lemon']
fruits[1] = 'apple'
print(fruits) # ['avocado', 'apple', 'mango', 'lemon']
last_index = len(fruits)
last_index = len(fruits) - 1
fruits[last_index] = 'lime'
print(fruits) # ['avocado', 'apple', 'mango', 'lime']

Expand All @@ -80,7 +80,7 @@
fruits = ['banana', 'orange', 'mango', 'lemon']
fruits.insert(2, 'apple') # insert apple between orange and mango
print(fruits) # ['banana', 'orange', 'apple', 'mango', 'lemon']
fruits.list(3, 'lime') # ['banana', 'orange', 'apple', 'mango', 'lime','lemon',]
fruits.insert(3, 'lime') # ['banana', 'orange', 'apple', 'mango', 'lime','lemon',]
print(fruits)

# remove
Expand All @@ -92,10 +92,10 @@

# pop
fruits = ['banana', 'orange', 'mango', 'lemon']
fruits.remove()
fruits.pop()
print(fruits) # ['banana', 'orange', 'mango']

fruits.remove(0)
fruits.pop(0)
print(fruits) # ['orange', 'mango']

# del
Expand Down Expand Up @@ -161,10 +161,10 @@
# Reverse
fruits = ['banana', 'orange', 'mango', 'lemon']
fruits.reverse()
print(fruits.reverse())
print(fruits)
ages = [22, 19, 24, 25, 26, 24, 25, 24]
ages.reverse()
print(ages.reverse())
print(ages)

# sort
fruits = ['banana', 'orange', 'mango', 'lemon']
Expand Down
2 changes: 1 addition & 1 deletion 08_Day_Dictionaries/08_dictionaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ person = {
'age':250,
'country':'Finland',
'is_marred':True,
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python']
'skills':['JavaScript', 'React', 'Node', 'MongoDB', 'Python'],
'address':{
'street':'Space street',
'zipcode':'02210'
Expand Down
4 changes: 2 additions & 2 deletions 12_Day_Modules/12_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,15 @@ print(randint(5, 20)) # it returns a random integer number between [5, 20] inclu
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.

```py
user_id_gen_by_user() # user input: 5 5
print(user_id_gen_by_user()) # user input: 5 5
#output:
#kcsy2
#SMFYb
#bWmeq
#ZXOYh
#2Rgxf

user_id_gen_by_user() # 16 5
print(user_id_gen_by_user()) # 16 5
#1GCSgPLMaBAVQZ26
#YD7eFwNQKNs7qXaT
#ycArC5yrRupyG00S
Expand Down

0 comments on commit 8a72b58

Please sign in to comment.