# -*- coding: utf-8 -*-
"""python_notebook.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1mqm4pGvmc9u7hjks9g3-LwizhLCuVJM6
"""

import numpy as np
import matplotlib.pyplot as plt
 
  
# creating the dataset
data = {'C':20, 'Perl':15, 'Java':30,
        'Python':35}
courses = list(data.keys())
values = list(data.values())
  
fig = plt.figure(figsize = (6, 4))
 
# creating the bar plot
plt.bar(courses, values, color ='red',
        width = 0.4)
 
plt.xlabel("Courses offered")
plt.ylabel("No. of students enrolled")
plt.title("Students enrolled in different courses")
plt.show()

10+20

"""To run the program you need to press ctrl+enter"""

#this is type coversion code, these are exmaples of explicit type conversions
result="10"
print(type(result))
print(float(result))
print(int(result))

mystring="abcdefg"
print(type(mystring))
print(list(mystring))
print(tuple(mystring))

mylist=["abc",10,"def",10.5]

print(type(mylist))
#converting from list to tuple
print(tuple(mylist))
#converting from list to string
changed_string=str(mylist)
print(changed_string)
print(type(changed_string))

#playing with dictionary
my_dict={"name":"ram","age":277,"score":67}
print(list(my_dict))

#example of range conversion to list and tuple
my_range=range(10)
print(list(my_range))
print(tuple(my_range))

#convert list or tuple to dictionary
#(1,2) and (3,4) are two tuples
#[(1,2),(3,4)] - list of tuples
#([(1,2),(3,4)]) -  one big tuple
print(dict([("student1","hari"),("student2","lakshmi")]))

"""Operator concepts in python"""

#Arthimetic operator
#(+)
print(2+3)
print("hello"+" world")
print(10.23+34.12345)
#False 0, True 1
print(True+True)
print(False+True)
list1=["hello", "students", 10, 3]
list2=["hai", "marks", 40, 60]
list3=list1+list2
print(list3)
# you cannot add list and tuple

#(-)
print(2-3)
print(10.234-4.546)
print(True-True)

#(*)
print("------------------------------")
print("-"*30)
mystring1="class"
print(mystring1*3)

#(/)
print(False/10)
print(True/3)


#floor division
print(7/2) #normal division
print(7//2) #excludes the decimal point and print least round value

#(**)
print(2**3)
print(25**2)

#assignment operators
var1=var2=var3=10

var1+=20 #var1=var1+20
var2-=30 #var2=var2-30
var3*=2 #var3=var3*2
print(var1)
print(var2)
print(var3)

#comparision operators
#diff between = and ==
myvar=10
myantvar=20
print(myvar==myantvar)

print(10==20)
print("hello"=="hello1")
print(False==False)

#(!=)

print(False!=False)
print(10!=10)
print(10!=20)
#(<)
print(10<20)
print(20>30)

#logical operator
#and table
print("this is and table")
print(True and True) #True
print(True and False) #False
print(False and True) #False
print(False and False) #False

print("this is or table")
print(True or True) #True
print(True or False) #True
print(False or True) #True
print(False or False) #False

myvar1=10
myvar2=20
mystr1="hello"
mystr2="hello"
print(myvar1<myvar2 and mystr1 != mystr2) #10<20 and "hello"!="hello" - 
#True and False
print(myvar1<myvar2 or mystr1 != mystr2)#10<20 or "hello"!="hello"
#True or False
print(20==20 and 30<40)


print(True and True)
print(True or False) #True
print(not(True or False)) #False

print(not(True))


# -*- coding: utf-8 -*-
"""python_notebook.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1mqm4pGvmc9u7hjks9g3-LwizhLCuVJM6
"""

import numpy as np
import matplotlib.pyplot as plt
 
  
# creating the dataset
data = {'C':20, 'Perl':15, 'Java':30,
        'Python':35}
courses = list(data.keys())
values = list(data.values())
  
fig = plt.figure(figsize = (6, 4))
 
# creating the bar plot
plt.bar(courses, values, color ='red',
        width = 0.4)
 
plt.xlabel("Courses offered")
plt.ylabel("No. of students enrolled")
plt.title("Students enrolled in different courses")
plt.show()

10+20

"""To run the program you need to press ctrl+enter"""

#this is type coversion code, these are exmaples of explicit type conversions
result="10"
print(type(result))
print(float(result))
print(int(result))

mystring="abcdefg"
print(type(mystring))
print(list(mystring))
print(tuple(mystring))

mylist=["abc",10,"def",10.5]

print(type(mylist))
#converting from list to tuple
print(tuple(mylist))
#converting from list to string
changed_string=str(mylist)
print(changed_string)
print(type(changed_string))

#playing with dictionary
my_dict={"name":"ram","age":277,"score":67}
print(list(my_dict))

#example of range conversion to list and tuple
my_range=range(10)
print(list(my_range))
print(tuple(my_range))

#convert list or tuple to dictionary
#(1,2) and (3,4) are two tuples
#[(1,2),(3,4)] - list of tuples
#([(1,2),(3,4)]) -  one big tuple
print(dict([("student1","hari"),("student2","lakshmi")]))

"""Operator concepts in python"""

#Arthimetic operator
#(+)
print(2+3)
print("hello"+" world")
print(10.23+34.12345)
#False 0, True 1
print(True+True)
print(False+True)
list1=["hello", "students", 10, 3]
list2=["hai", "marks", 40, 60]
list3=list1+list2
print(list3)
# you cannot add list and tuple

#(-)
print(2-3)
print(10.234-4.546)
print(True-True)

#(*)
print("------------------------------")
print("-"*30)
mystring1="class"
print(mystring1*3)

#(/)
print(False/10)
print(True/3)


#floor division
print(7/2) #normal division
print(7//2) #excludes the decimal point and print least round value

#(**)
print(2**3)
print(25**2)

#assignment operators
var1=var2=var3=10

var1+=20 #var1=var1+20
var2-=30 #var2=var2-30
var3*=2 #var3=var3*2
print(var1)
print(var2)
print(var3)

#comparision operators
#diff between = and ==
myvar=10
myantvar=20
print(myvar==myantvar)

print(10==20)
print("hello"=="hello1")
print(False==False)

#(!=)

print(False!=False)
print(10!=10)
print(10!=20)
#(<)
print(10<20)
print(20>30)

#logical operator
#and table
print("this is and table")
print(True and True) #True
print(True and False) #False
print(False and True) #False
print(False and False) #False

print("this is or table")
print(True or True) #True
print(True or False) #True
print(False or True) #True
print(False or False) #False

myvar1=10
myvar2=20
mystr1="hello"
mystr2="hello"
print(myvar1<myvar2 and mystr1 != mystr2) #10<20 and "hello"!="hello" - 
#True and False
print(myvar1<myvar2 or mystr1 != mystr2)#10<20 or "hello"!="hello"
#True or False
print(20==20 and 30<40)


print(True and True)
print(True or False) #True
print(not(True or False)) #False

print(not(True))


# -*- coding: utf-8 -*- python_notebook.ipynb  Automatically generated by Colaboratory.  Original file is located at     https://colab.research.google.com/drive/1mqm4pGvmc9u7hjks9g3-LwizhLCuVJM6 # creating the dataset # creating the bar plot To run the program you need to press ctrl+enter #this is type coversion code, these are exmaples of explicit type conversions #converting from list to tuple #converting from list to string #playing with dictionary #example of range conversion to list and tuple #convert list or tuple to dictionary #(1,2) and (3,4) are two tuples #[(1,2),(3,4)] - list of tuples #([(1,2),(3,4)]) -  one big tuple Operator concepts in python #Arthimetic operator #(+) #False 0, True 1 # you cannot add list and tuple #(-) #(*) #(/) #floor division #normal division #excludes the decimal point and print least round value #(**) #assignment operators #var1=var1+20 #var2=var2-30 #var3=var3*2 #comparision operators #diff between = and == #(!=) #(<) #logical operator #and table #True #False #False #False #True #True #True #False #10<20 and "hello"!="hello" - #True and False #10<20 or "hello"!="hello" #True or False #True #False