Skip to content

Commit cfad932

Browse files
committed
Added Video Link on 03.input.md
1 parent 66bec37 commit cfad932

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

01-python-introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Introduction to Python
22

3-
**Video Link:** https://www.youtube.com/watch?v=B7G5B8P8k9s
3+
**Video Link:** [https://www.youtube.com/watch?v=B7G5B8P8k9s](https://www.youtube.com/watch?v=B7G5B8P8k9s)
44

55
***
6-
Python is a powerful general-purpose programming language. It is used in
6+
Python is a powerful general-purpose programming language. It is used in:
77

88
* Machine Learning
99
* Web Development

02-variables.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Hello World
3636
Python 3 is awesome
3737
```
3838

39+
---
40+
3941
### Program to Print Numbers
4042

4143
The `print()` function can also be used to print numbers. There are two commonly used numeric data in Python:
@@ -57,6 +59,8 @@ print(34.5)
5759
34.5
5860
```
5961

62+
---
63+
6064
## Variables in Python
6165

6266
We use variables to store data and use them later in the program.
@@ -78,6 +82,8 @@ print(city)
7882
Kathmandu
7983
```
8084

85+
---
86+
8187
### Change Value Stored in a Variable
8288

8389
We can also change the data a variable holds.
@@ -99,6 +105,8 @@ Kathmandu
99105
New York
100106
```
101107

108+
---
109+
102110
### Assign one Variable to Another
103111

104112
```python
@@ -140,6 +148,8 @@ print(pi)
140148
3.14
141149
```
142150

151+
---
152+
143153
## Print Multiple Objects in One print()
144154

145155
We can print multiple objects in a single `print()` function by separating them with commas.
@@ -173,6 +183,8 @@ print("City:", city, "KFC Locations:", kfc_locations)
173183
City: Kathmandu KFC Locations: 3
174184
```
175185

186+
---
187+
176188
## Giving Good Variable Names
177189

178190
We should always try to give descriptive and meaningful variable names so that it's easier to understand our code.

03-input.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Take Input from the User
22

3-
**Video link:**
3+
**Video link:** [https://youtu.be/DRBybZ6hsY0](https://youtu.be/DRBybZ6hsY0)
44

55
In this video, we learned to take input from the user.
66

@@ -35,6 +35,8 @@ Felix
3535
Felix
3636
```
3737

38+
---
39+
3840
### Printing Message Before Input
3941

4042
We can pass a string message inside `input()` to make our program descriptive.
@@ -53,6 +55,8 @@ Enter name: Felix
5355
Felix
5456
```
5557

58+
---
59+
5660
## Trying to take numeric input
5761

5862
The `input()` function always takes input in the string format. We can check this by using the `type()` function.
@@ -72,6 +76,8 @@ print(type(number))
7276

7377
`<class 'str'>` means it's a string.
7478

79+
---
80+
7581
### Print data type of integers and floating-point numbers
7682

7783
```python
@@ -91,6 +97,8 @@ print(type(number2))
9197
<class 'float'>
9298
```
9399

100+
---
101+
94102
## Convert strings to integers and floats
95103

96104
We cannot directly take numeric inputs using the `input()` function. However, we can convert strings to integers and floats using the 'int()' and 'float()' functions respectively.
@@ -129,6 +137,8 @@ print(type(number))
129137
<class 'int'>
130138
```
131139

140+
---
141+
132142
### Convert strings to floats
133143

134144
Similary, we can use `float()` to convert a string to a floating-point number.
@@ -146,6 +156,8 @@ print(type(number))
146156
<class 'float'>
147157
```
148158

159+
---
160+
149161
## Convert non-numeric strings to numbers
150162

151163
We can only convert numeric strings (string in number format) to numbers. If we try to convert non-numeric strings to numbers, we will get an error.

0 commit comments

Comments
 (0)