Uh oh!
There was an error while loading. Please reload this page.
Added Chapter 4 of Level 1 of Python Tutorial - #11
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
CodesMaha
left a comment
There was a problem hiding this comment.
Wonderful changes so far. Perhaps a few more to go.
| ## `print()` | ||
| The `print` function is used to print/show something on the screen (also known as the terminal or | ||
| standard output). With this you can write the first program that every programmer writes when they |
There was a problem hiding this comment.
With this you can
Usually, you add a comma after an introductory phrase like 'with this'.
| ``` | ||
| Each `print` statement prints on a new line. You can print multiple things using a single `print` | ||
| statement by separating them using commas(`,`), which will result in all the values being printed on |
There was a problem hiding this comment.
Forgot a space after "commas"? Like that you added the comma after the brackets, though; well done.
| !!! note | ||
| Keep in mind that this works only in `print` and can NOT be used to combine different strings or |
There was a problem hiding this comment.
By the way, though "can not" is also fine, "cannot" is often recommended. (For emphasis, one could use uppercase letters for the entire word "cannot".)
| Now you know how to take input from the user, but, the `input` function returns a `str` no matter | ||
| what the user types. So, for example, if the user types `54`, it will return a `str` (`"54"`), not | ||
| an `int` (`54`). So if you want to use the number the user entered, you will need to convert the |
There was a problem hiding this comment.
So if you want to use …
A comma after the transition 'so' would be preferred.
| ### Explicit Type Casting | ||
| Python has many built-in functions for explicit type casting, and they are named the same as the | ||
| data type it casts to. Here is the list of type-casting functions with the type they cast to: |
There was a problem hiding this comment.
they are named the same as the data type it casts to
Since we are using a plural pronoun "they", it would be more suitable to use "they cast" instead of "it casts" afterwards.
| | `int()` | `int` | | ||
| | `str()` | `str` | | ||
| For example, to get a number from the user you can do this: |
There was a problem hiding this comment.
to get a number from the user you can do this
A comma before "you can do" would be preferred. Alternatively, the different parts can be switched like so:
you can do this to get a number from the user
No description provided.