Steemers Coding Class 01 - Learn coding 10 minutes a day for very beginnerssteemCreated with Sketch.

in #howto8 years ago (edited)

Yo Steemrs, I'm Pooria.

As I explained in my intro yesterday I'm starting a coding class here. Get ready for some awesomeness and enjoy the ride.

Steem Coding Class

How ?

Coding is easy, much easier than what you think. Though starting it and doing it professionally is hard.

In this series of short tutorials I'm trying to teach coding step by step to beginners. The goal is not to get into unnecessary theoretical explanations and jump into writing codes that show us some results early on. This approach is perfect for people who learn by doing (like me) and are confused by the amount of explanation written by other learning resources. Enough of talking, let's start!

Language

I use Python 3.0 to teach coding in these tutorials. The reason I choose this language is selfish because I want to review it myself and writing these articles gives me the opportunity to do so! However, It's one of the best languages to start coding with. It's simple to learn, the skill set is easily transferable to other languages and it's very much popular. Services like Instagram are created with Python, you can build websites with it, get lots of freelance gigs and it's the pathway for getting into making hardwares (Raspberry Pie, Arduino) as well!

How to run codes?

Don't worry you don't need to setup anything or have any special operating system. In this tutorials we use Repl to run our codes. You just need to open the link, no signup required and start coding! That's it.

Tip: you write the code in the left side of screen. Hit the run button on top and see the results on the right side

Let's Code

Coding is basically giving instructions to computer to do things for us. For those instructions to be meaningful we need to store values (like numbers) in the memory to do some calculation on them. We call those values variables. In order to works with variables we should give names to them like this:

x = 1

We can change them and do basic calculations with them:

x = 1
x = x + 1
x = x - 1
x = x * 2
x = x / 2

** Note: * is multiply and / is division **

Amazing! now we have a place in memory of our computer that we stored number 1 inside it. Whenever we want to use that number we call it by it's name which is x. Makes sense huh?

There are different types of variables. But for now let's only work with two popular ones. Strings (texts) and Integers (numbers). For strings you should put them inside " or ' but for numbers there is no need for that.

A string:

my_name = "Pooria"

An Integer:

my_age = 26

As you can see this time I used more meaningful names for my variables. Remember to don't start a variable name with a number and don't use spaces in it.

We can also show messages on the screen:

print("Hello Steemers!")

Run the code above in your editor (Repl) and see the result in the right side.

Working with variables

Amazing. Now we know about variables and learned how to show output to our users. Let's learn how to output variables:

my_name = "Pooria"
print("Hello ", my_name)

As you can see I used a , to chain (as we say concatenate) Hello to the variable of my name.

Try the code and see the result.

More variations:

my_name = "Pooria"
my_age = 26
print("Hey " , my_name, " How is it going buddy?")
print(my_age, " years old isn't that bad")

Don't copy/paste, type it inside the editor from scratch. If you copy you will forget it simply two days later!

Getting input from user

It's also damned simple. We want our user to give us his/her name.

name = input("Please enter your name")

That's it. This statement will wait for user to type his/her name and put it inside a variable called name.

Try it yourself

Now your turn. Open this link and write a program to:

Get the name of user and her age. Say hello to the name and print she looks 3 years younger than how old she actually is

Example:

Please enter your name: Pooria
Please enter your age: 26
Hi Pooria, you look 23

Ask your questions and write the code in comments if you want a review from me and please follow my account to get the other tutorials as I write them.

Cheers,
Pooria

Image Source: https://www.instagram.com/ghanipradita/

Sort:  
Loading...

what an awesome idea! :)

nteresting post my friend @ p0o, I congratulate his passion that puts in his notes, congratulations for this magnificent material

Thanks man, your comment is full of positivity and awesome vibes :-)

You deserve it my friend, congratulations

you will be glad to know that i had a play. very cool! :) - i had no idea about repl :)

Thanks for supporting my friend. Are you in a learning process or you are ahead of the content I'm writing here?

i'm just learning new stuff today.

Awesome, hope to see you around more.

this is great thanks for doing this I'll have to start doing this.

Thank you. Yes please invest the time daily, practice and follow this tutorials. Learning to code will pay off well.

Thks @p0o for bringing these classes to the community. These will help bring new developer to quickly learn about Steem Blockchain and build new services for community members. I highly support this project.

Thank you for your support. I also need to notice that these tutorials are not about coding for blockchain but coding in general. We have plans for writing more professional tutorials about blockchain but this series is only for people to get started with coding in the first place :-)

Thanks again, we will definitely learn from this, I've tried it and enjoying, cant wait for the rest.

Thanks for the support my friend.

I've tried and everything goes nice. Will follow u and continue learning.
thks for this initiative.

Awesome!

Great post @p0o I'm a coder too. I wnat to start making coding lesson as well. Follow mi if you are interested. I'm gonna follow you

Coin Marketplace

STEEM 0.24
TRX 0.12
JST 0.030
BTC 69681.57
ETH 3699.44
USDT 1.00
SBD 3.25