class ClassExample:def __init__(self, collegeName):self.collegeName = collegeNamedef display(self):print("My college name is " + self.collegeName)object = ClassExample("GITAM")object.display()
code = 12name = "GITAM"branch = "CSE"location = "Visakhapatnam"print(str(code) + " " + name + " " + branch + " " +location)
rollno = str(121710303001)name = "Aditya"cgpa = int(7.87)per = float(9)print("Rollno : " , rollno )print("Name :" , name)print("CGPA :" , cgpa)print("Percentage : ", per)
You can get the data type of a variable using the type()
function.
rollno = 121710303001name = "Aditya"cgpa = 7.87print(type(rollno))print(type(name))print(type(cgpa))