-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0x00-hello_world.py
executable file
·38 lines (31 loc) · 1017 Bytes
/
0x00-hello_world.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python3
# process finished with exit code 0 means that there were no errors in the program.
# Data types in python, use type() to check the data type
# =======================================================
# string ---> <class 'str'>
name = "Zaphdev"
print(type(name))
first_name = "Zaph"
last_name = "dev"
full_name = first_name + last_name
# numbers ---> <class 'int'>
age = 22
age += 1
age -= 1
age *= 1
print(type(age))
# typecasting variables, in this case integer to string
print("Your age is "+str(age))
# float data type ---> <class 'float'>
# stores numbers that include decimal portion
height = 250.5
print(type(height))
# Boolean data type: True or False ---> <class 'bool'>
human = False
print(type(human))
# Multiple assignment in python
# Allows us to assign multiple variables in the same line in python.
# ==================================================================
name, age, attractive = "Bro", 21, True
num1 = num2 = num3 = num4 = 30
# num1 to num4 have the same values.