Beginning Python (Some Basics)

Ronan McClorey
2 min readNov 22, 2020

--

With software engineering, there are many different languages and frameworks to choose from while building out apps or projects. Each language is seen to have its own benefits and drawbacks. I like to see what's out there, what is popular, and what people are using often to build new products. I’ve worked mostly with JavaScript and Ruby programming languages going through the Flatiron School Software Engineering program. Often I see Python as being a very popular and widely used language so I started learning it to add to what I know.

Photo by Divide By Zero on Unsplash

Starting to learn any new language for me I see what’s similar in this language to the languages I know. If I know how to do something or create something in another language how can I translate it in this language, just to get started and get used to the new syntax. The language I’ve been using the most before Python has been JavaScript so I will place some comparisons with the syntax and what is close to the equivalent (in some basic concepts).

First working with JavaScript one thing I used often to find values or ensure what I was working on was working like I wanted it to was ‘console.log(test)’ to print a value to the console. With python to do this, the code is simply ‘print(test)’. In JavaScript

console.log("Hello")

this in Python would be

print("Hello")

Another common task while programming is declaring variables. In JavaScript, I am used to using let, const, and var(not used very often). With Python, however, none of this is needed you can simply state the variable name followed by the value you wish to assign to that variable. So,

let name = "Ronan"

would be in Python

name = "Ronan"

Using string interpolation, with JavaScript string interpolation is done with backticks and ${} within the backticks in order to interpolate the value inside. In Python, a similar result is achieved by using f-string by placing an f before the quotes and inside the quotes using {}. So, with JavaScript, it would be

`Hi, ${name}`

and with Python, this would be

f"Hi, {name}"

Listed above are simply three basic things often used in coding and comparisons to a language that I am more familiar with. To get started and used to the different syntax I find it helps to compare to what you know.

I am beginning to learn python through 100 Days of Code — The Complete Python Pro Bootcamp for 2021 and am still comparing it to JavaScript as I start to learn and go through the course.

--

--

No responses yet