-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathroot.py
More file actions
40 lines (30 loc) · 1.16 KB
/
Copy pathroot.py
File metadata and controls
40 lines (30 loc) · 1.16 KB
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
# devontae jarquavis the second third and forth
# Assignment Examples
# you can assign values to variables by using an = sign (Right side goes into left)
x=5
# when python reads a variable name it replaces it with the variables stored values
y= x + 5
# there are 4 different primitive data types
#integers: any whole number + or -
age = str(2000000)
#float: any number with a decimal, positive or negative
grade=98.6
#string:a string or human readable characters
name="Devontae"
#numbers in a string are not numbers, they are character/ letters
favoritenumber="69"
# whatever comes after a \ is a character and not a quote
#boolean:a true or false variable
# true is any value that is not false or empty
yourmom=False
# you can output to the console by using print
print(x,y,age,grade,name,favoritenumber,yourmom)
# you can concatenate values together
print(" My name is " + name)
# you can use functions to convert data types
print (" my age is " + age)
# if you want to convert a value permenantly you must assign the converted value to a variable
# you can convert back in forth with , int(), str(),bool(), and float()
print(int(age))
print (float(age))
print(bool(age))