forked from dscnsec/Python-Bootcamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1_variables.py
39 lines (29 loc) · 829 Bytes
/
1_variables.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
39
#This is a basic python script to demonstrate diffent types of variables
#This is a single line comment
#This is a string variable
#String variables are enclosed in single or double quotes
name = "GDSC"
#This is an integer variable
#Integer variables are whole numbers
age = 1
#This is a float variable
#Float variables are decimal numbers
pi = 3.14
#This is a boolean variable
#Boolean variables are either True or False
isTrue = True
#This is a list variable
#Lists are mutable
list = [1,2,3,4,5]
#This is a dictionary variable
#Dictionaries are key value pairs
dict = {"name":"GDSC","age":1}
#This is a tuple variable
#Tuples are immutable
tuple = (1,2,3,4,5)
#This is a set variable
#Sets are unordered and unindexed
set = {1,2,3,4,5}
#This is a complex variable
#Complex numbers are of the form a+bj
complex = 1+2j