From the course: Python for JavaScript Developers

Unlock the full course today

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

Strings and formatting: Python vs. JavaScript

Strings and formatting: Python vs. JavaScript - Python Tutorial

From the course: Python for JavaScript Developers

Start my 1-month free trial

Strings and formatting: Python vs. JavaScript

- [Instructor] So when you look at it from 1000 miles away, strings in JavaScript and Python behave somewhat similar. So I wanted to start with an example here in chapter 02-04 just to make sure we're all on the same page. So this is some modern JavaScript using string interpolation, and we define a constant which is my name, Ronnie. And then we create a greet. So we basically interpolate the name into the greeting. So this could be modified in other places. We then console log this. So this is, I guess, a good starting point. So we'll move on to looking at this in Python and building on this example. So let's head over to the terminal and run this. So here I am at my terminal and I'm going to type in Node, since this is a JavaScript file, ch_02_04.js and I get a hey Ronnie printed out. So let's clear that and let's head over and look at some Python. So on line one, you'll see that I use all caps for my constant. We…

Contents