Hi there! Today is Day 2 of 100 Days of code.
I really enjoyed developing applications with python for the last 2 days and I believe, every day will be like this. 😎
In today's lessons, I've learned about datatypes, numbers, operations, type conversion, and f-strings.
Here is some code,
Datatypes ✅
"Hello" # String
15 # Integer
9.3241 # Float
True, False # Boolean
Numbers ✅
x = 1 # int
y = 2.8 # float
Operations ✅
2 + 5 # Add
5 - 1 # Subtract
6 * 5 # Multiply
8 / 4 # Divide
12 ** 4 # Exponent
Type Conversion ✅
s = "25"
type(s) # print <class 'str'>
new_s = int(s) # converting to int
print(new_s) # resul 25
type(s) # print <class 'int'>
F-strings ✅
name = "Fatih"
print(f"Hello, {name}") # print Hello, Fatih
At the end of the day, I made a calculator with everything I learned in the previous lesson and the previous day.
Discussion (1)
Awesome!! Keep up the great work 🙌