Popular posts from this blog
Python tutorials for beginners
DATA TYPES IN PYTHON
Integer and Float • Variables can hold values of different types called data types. Some of the commonly used data types in python are integer, float, bool, strings, lists, tuples, dictionary, sets, etc • The data type of a variable is dependent on the value of the variable. For example, if the value of the variable userAge is 18 i.e userAge = 18 Here the data type of the variable is an integer. • For float data type the value of the variable should be a decimal. For example, if you create a variable for the percentage of students in class studentPercentage with a value 78.5 i.e studentPercentage = 78.5 Strings • A string data type is used to store textual information into a variable. • To store the value of a string data type, we need to put the value inside double quotes 11 " or single quotes ''. For example schoolName = "Bright International" characterName = 'Eva' ...
Comments