Variables in Python Variables are the character(s) used to store a value to be used further in the program. For example, when you want to store roll number of a student in the program then we use some variables to store roll number data: Roll_no = 35 In the above statement we use an identifier(Roll_no) to store roll number of a student of integer type. Then we can call Roll_no a numeric variable. Em_name = “Sanu” Then we can call Em_name a string variable. IMPORTANT: In Python, you cannot use integer, float, complex number, expression as a variable as it will raise an error. You can only use characters, or identifiers to store any value. For example: 36=Id 25=x 2a/c=20 In Python, you can use multiple assignments. #that’s nice For example: A,B,C=5,10,15 x=y=z=50 Dynamic Typing A variable who is used to store a value of one type, can be used again to store a value of different type. Python uses D
Comments
Post a Comment