Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 3 additions & 26 deletions 03_Day_Operators/03_operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,6 @@ print('a // b = ', floor_division)
print('a ** b = ', exponential)
```

**Example:**

```py
print('== Addition, Subtraction, Multiplication, Division, Modulus ==')

# Declaring values and organizing them together
num_one = 3
num_two = 4

# Arithmetic operations
total = num_one + num_two
diff = num_two - num_one
product = num_one * num_two
div = num_two / num_one
remainder = num_two % num_one

# Printing values with label
print('total: ', total)
print('difference: ', diff)
print('product: ', product)
print('division: ', div)
print('remainder: ', remainder)
```

Let us start connecting the dots and start making use of what we already know to calculate (area, volume,density, weight, perimeter, distance, force).

**Example:**
Expand Down Expand Up @@ -220,8 +196,9 @@ In addition to the above comparison operator Python uses:
print('1 is 1', 1 is 1) # True - because the data values are the same
print('1 is not 2', 1 is not 2) # True - because 1 is not 2
print('A in Asabeneh', 'A' in 'Asabeneh') # True - A found in the string
print('B not in Asabeneh', 'B' in 'Asabeneh') # False - there is no uppercase B
print('coding' in 'coding for all') # True - because coding for all has the word coding
print('B not in Asabeneh', 'B' not in 'Asabeneh') # True - there is no uppercase B
print('B not in Asabeneh', 'b' not in 'Asabeneh') #False - tere is b in the string
print('coding' in 'coding for all') # True - because 'coding for all' has the word 'coding'
print('a in an:', 'a' in 'an') # True
print('4 is 2 ** 2:', 4 is 2 ** 2) # True
```
Expand Down
5 changes: 4 additions & 1 deletion 04_Day_Strings/04_strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@ It is possible to skip characters while slicing by passing step argument to slic

```py
language = 'Python'
pto = language[0:6:2] #
pto = language[0:6:2] # slicing starts at index 0 (inclusive) and ends at index 6 (exclusive) with increment of 2
print(pto) # Pto
# Starts at `0` -> Grabs **P**
# Jumps +2 to `2` -> Grabs **t**
# Jumps +2 to `4` -> Grabs **o**
```

### String Methods
Expand Down