From the course: Transition from C# to Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Variables and data types

Variables and data types

From the course: Transition from C# to Python

Start my 1-month free trial

Variables and data types

- [Instructor] Now, let's take a look at defining variables in Python along with the supported data types. And to do that, I'm going to go to my variables folder and let's go ahead and open up the C# version first. In C#, variables are declared before they're used and they have a type definition. So here in this example, you can see I have some variables of different types. I've got integer, float, string and bool. And I've got some initial values for each one. And of course, you can also use the var keyword to declare a variable and then just let the compiler figure out the type for you which in this case, is a string. And I'm going to run this. And just a quick note, if you're using Visual Studio code, you don't have to keep going out to your terminal. You can actually just right click on the name of a folder and choose open in integrated terminal. And you can use the built in Visual Studio terminal, just like this. So…

Contents