From the course: Introduction to Career Skills in Software Development
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Exploring variables across languages - Python Tutorial
From the course: Introduction to Career Skills in Software Development
Exploring variables across languages
- [Instructor] Depending on the programming language you're working with, variables can behave differently. Some languages require that you define your variables and their types before using them, like Java, C#, and C++. For example, if we want to store a user's age in Java, we would have to first declare that it will be of type int and then give our variable a name, age. We get 37 as our output when we run this code. Now let's compare this to a more relaxed language, like JavaScript. We don't need to declare a variable's type with JavaScript before using it. Here we declare the variable and use it at the same time, but I'd like you to notice a couple of things. First, we provide the name, not the type of the variable. And we use a keyword const to represent that once we get this value, we don't want it to change. When we run this code, the JavaScript interpreter can figure out the type based on our value. There are pros and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
Statements and expressions across languages3m 21s
-
(Locked)
Exploring variables across languages2m 6s
-
(Locked)
Making decisions in code across languages1m 38s
-
(Locked)
Tech careers and their associated programming languages3m 8s
-
(Locked)
Challenge: Pick the language1m 3s
-
(Locked)
Solution: Pick the language1m 32s
-
-
-