From 87b19a10cb2e41e559c5bc50d98df35f94c62421 Mon Sep 17 00:00:00 2001 From: tteodorescu0 Date: Fri, 21 Jun 2024 19:21:24 -0400 Subject: [PATCH] Update 02.Data-types-convertion-basic-operations.md Typos and editorial changes --- 02.Data-types-convertion-basic-operations.md | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/02.Data-types-convertion-basic-operations.md b/02.Data-types-convertion-basic-operations.md index 6a80f7d..c26d586 100644 --- a/02.Data-types-convertion-basic-operations.md +++ b/02.Data-types-convertion-basic-operations.md @@ -1,6 +1,6 @@ # Lesson 2: Data Types -> In the world of programming, data types are the building blocks that shape the digital landscape." +> In the world of programming, data types are the building blocks that shape the digital landscape. ## Content @@ -30,7 +30,7 @@ my_age = 22 print("There are", number_of_apples, "apples in the basket") print(type(number_of_apples)) -print("My age is:" my_age) +print("My age is:", my_age) print(type(my_age)) ``` @@ -42,7 +42,7 @@ My age is: 22 ``` -As `python` is a dynamical language (it means that the programmer doesn't declare types _explicitly_) this can cause some issues in the future with advanced data types. So if you are not sure what type is stored in the variable don't hesitate to call `type()`. +As `Python` is a dynamical language (it means that the programmer doesn't declare types _explicitly_), this can cause some issues in the future with advanced data types. So if you are not sure what type is stored in the variable, don't hesitate to call `type()`. ### 1.1 float @@ -56,7 +56,7 @@ Sometimes, you'll see really big or small floats written with an "e" which is ju # Float apple_price = 0.99 -print("Apple price:", apple_price, "pounds") +print("Apple price:", apple_price, "dollars") print("Type of apple_price variable:", type(apple_price)) ``` @@ -73,7 +73,7 @@ In `Python`, you can perform _all_ the basic mathematical operations you're fami This includes `addition`, `subtraction`, `multiplication`, `division`, and even more complex operations like `exponentiation`. -Here are the the table where each operator described within `Python` syntax" +Here is a table that describes each operator. | Operator | Description | @@ -122,7 +122,7 @@ Exponentiation of 15 to the power of 4 = 50625 Modulo of 15 by 4 = 3 ``` -Here is a practical task which we remeber from school, where we need to calculate the `circumference` of the circle +Here is a practical task, which you may remember from school, where we need to calculate the `area` and `circumference` of a circle. #### Example @@ -157,7 +157,7 @@ Circumference of the circle: 31.4159 A string in `Python` is a _series of characters_. It is used to represent text. -As you know already, strings in `Python` are enclosed either in single quotes `(')` or double quotes `(")`, and they can include _letters_, _numbers_, and _various symbols_. Also when we ask a user for input, we store the `str` type into the variable. +As you know already, strings in `Python` are enclosed either in single quotes `(')` or double quotes `(")`, and they can include _letters_, _numbers_, and _various symbols_. Also when we ask a user for input, we store the input provided by the user into a `str` type variable. #### Example ```python @@ -174,10 +174,10 @@ print("Name of the student is", student_name) #### Output ```python -Hello, Python learners! -The course you are taking is called: The best Python Course in the United Kingdom, or even in the world! - +Input your name: >> Adam +Hello, Python learners! +The course you are taking is called: The best Python Course in the United Kingdom, or even in the whole world! Name of the student is Adam ``` @@ -212,7 +212,7 @@ It's especially important when the data type of a value ### 4.1 Implicit Conversion -In this example, `Python` automatically converts data types after ariphmetical operation. +In this example, `Python` automatically converts data types after an arithmetical operation. #### Example @@ -238,9 +238,9 @@ Type of total: Explicit conversion requires the programmer to convert data types manually. Python provides functions like `int()`, `float()`, `str()`, etc.. for explicit conversions. -There are several examples provided below which explain the need of such converstaions. +There are several examples provided below that explain the need of such conversations. -If we try to make math operations between strings, it will result in an error: +If we try to apply math operations to strings, it will result in an error: #### Incorrect Usage @@ -265,11 +265,11 @@ Traceback (most recent call last): TypeError: unsupported operand type(s) for -: 'str' and 'str' ``` -**Note:** In such cases we would want to convert the `types` of variables +**Note:** In such cases we would want to convert the `types` of variables. #### Correct Usage -This is a recommended approach +This is a recommended approach. ```python # These variables are ``strings`` representing ``numbers``