Python variables with and without quotes


#1

Sorry I just had a question so I can’t use the template but what’s the difference between the variables with and without quotes. like var = 10 and var = “10”. Are they different? and what do they do?


#2

var = 10 is setting the variable var equal to the integer 10.

var = "10" is setting the variable var equal to the string "10".

A string and an integer are two different data types, Strings are text. Integers are numbers. They have many different uses which you will learn more about as you continue the course.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.


#4