class ClassExample: def __init__(self, collegeName): self.collegeName = collegeName def display(self): print("My college name is " + self.collegeName) object = ClassExample("GITAM") object.display()
code = 12 name = "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 = 121710303001 name = "Aditya" cgpa = 7.87 print(type(rollno)) print(type(name)) print(type(cgpa))
RELATED TAGS
CONTRIBUTOR
View all Courses