Skip to content

03 variables

anjali0706 edited this page Aug 5, 2019 · 2 revisions

Number

creating Integer variable

a = 10 print(type(a))

String

str1 = 'hello Ram' #string str1 using single quote
str2 = "How are you" #string str2 using double quote print(str1) print(str2)

List

a = [5,10,15,20,25,30,35,40] print(a)

Tuples

my_tuple = (1, 2.8, "Hello Ram") #tuple of int, float, string print(my_tuple)

Dictionary

dictionary_list = {1:'Ram', 2:'Shyam', 3:'Balram', 4:'Raju'};
print (dictionary_list);
print (dictionary_list.keys());
print (dictionary_list.values());

Clone this wiki locally