diff --git a/03_Day_Operators/03_operators.md b/03_Day_Operators/03_operators.md index 972b56943..afe4f16bf 100644 --- a/03_Day_Operators/03_operators.md +++ b/03_Day_Operators/03_operators.md @@ -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:** @@ -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 ``` diff --git a/04_Day_Strings/04_strings.md b/04_Day_Strings/04_strings.md index 9d09d2cfe..a396ec7af 100644 --- a/04_Day_Strings/04_strings.md +++ b/04_Day_Strings/04_strings.md @@ -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