In [ ]:

```
print("Hello World")
```

Values are a form of representation or description.

For example, a person's name is

In [ ]:

```
"Roth Longbottom"
```

The number of days I have to go school is

In [ ]:

```
5
```

**Commenting** is a form of notation. Python ignores everything after the hashtag `#`

In [ ]:

```
# This is a comment
```

In [ ]:

```
# This line of code will not run
"but this line will"
```

Numbers are categorised into 2 types

- Integers (Whole numbers)
- Floats (Decimal numbers)

Find out which type they are by using the function `type()`

In [ ]:

```
1 # Integer
print(1)
type(1)
```

In [ ]:

```
1.0 # Float
print(1.0)
type(1.0)
```

Strings refer to texts and are defined with quotation marks `" "`

.

In [ ]:

```
"This sentence is a string"
```

In [ ]:

```
"5.0 is also a string here as it is within the quotation marks"
```

Is "6" a string or an integer?
Find out with `type()`

function!

In [ ]:

```
```

Find out whether the following are integers, floats or string

- 3.1415
- 9
- "12309"
- "Hi, what is your name?"
- 3 + 19

In [ ]:

```
```

Variables are storage for your values. Imagine having a `box`

and putting an `apple`

inside.

In [ ]:

```
box = "apple"
```

Now try accessing the box to see what is inside by typing `box`

and pressing <Shift + Enter>

In [ ]:

```
```

What happens if you accessed a random_box?

In [ ]:

```
random_box
```

Can you figure out why?

- Must start with letter
- Does not contain spaces (use
`_`

to substitute) - Must not be a function name e.g if, else, def, for

Try creating some variables that stores value!

In [ ]:

```
```

- box_1
- box 1
- box1
- 1stbox
- Box_1

In [ ]:

```
```

Store the following numbers in variables and obtain the total

- 51 --> first_num
- 48 --> second_num
- 23 --> third_num
- 93 --> fourth_num

total = `?`

In [ ]:

```
```

You realised you made a mistake in the third number. It was supposed to be `85`

instead of `23`

. Find the new total.

In [ ]:

```
```

After finding the new total, you wanted to compare what was the difference between the wrong answer.

In [ ]:

```
```

Why is there a need to use variables?

Why not type out the answers directly?

Type your answers in `comments`

#

In [ ]:

```
```

Sometimes you want to add numbers instead of string. For example

In [18]:

```
# 100 + 900 = 1000
"100" + "900"
```

Out[18]:

'100900'

Did the above give you the correct answer? What can you do to get the correct answer?

**Hint** Try using the functions `int()`

, `float()`

, `str()`

In [ ]:

```
```

You are given the following variables. You want to see the difference between the `+`

function in string and in int/floats.

Fix the variable names before finding the answer.

In [ ]:

```
var1 = 549
var2 = "948"
3rdvar = 999
var 4 = 123
lastVar = 340
```

In [ ]:

```
```

- Integers
- Floats
- Strings
`Type()`

- Variables
- Values
- Converters/Casting

In [ ]:

```
```

In [4]:

```
subject = input("What is your favourite subject?: ")
level = input(f"How much do you like {subject}? ")
print(f"I {level} {subject}! ")
```

What is your favourite subject?: python How much do you like python? love I love python!

In [ ]:

```
```

In [ ]:

```
```

In [ ]:

```
```