Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Python - First steps
Flavio Campelo
Flavio Campelo

Posted on • Edited on

     

Python - First steps

📮 Contact 🇧🇷 🇺🇸 🇫🇷

Twitter
LinkedIn


Why should you choose Python?

Python is a modern program language and it's easy to learn. You can use it in a variety of solutions like data science, machine learning, web development, GUI development, iot, and others. There's a strongPython community that supports this language.

How to install Python?

Python is already available by default for the most of Linux and UNIX distributions. If you're using windows OS, it's possible to useWindows Subsystem for Linux akaWSL to use your favorite linux distribution in your machine. It's really easy to do this. Read theMicrosoft official documentation to know how to install it.

If you prefer to install pyhton, you can see further informationshere.

You can run this command to confirm that Python is installed

For UNIX or Linux distros

python3--version
Enter fullscreen modeExit fullscreen mode

Image 1

For Windows

py--version
Enter fullscreen modeExit fullscreen mode

Image 2

Start using Python

You should to consider the commandpython3 forUNIX orLinux distros andpy forWindows

You can use the command line to execute Python like this.

python3
Enter fullscreen modeExit fullscreen mode

Image 3

And then, you can start coding like that

2+5
Enter fullscreen modeExit fullscreen mode

Image 4

Using an IDE

I really suggest you to use a modern IDE for coding. For this example I'll useVisual Studio Code akaVSCode, but you can choose another one. Python website has apage to show you some recommended IDEs to use.

When VSCode is installed, you can click onExtensions icon and typePython on search bar. Then you can click install underPython extension developped by Microsoft.

Image 5

Now you able to write your first code. For that you can create a new file calledhello.py. Insert the a code inside this file.

print ('Hello world!')

and run it to see the result on the terminal.

Image 6

Notes
  • You can access this code ongithub.
  • py extension is either called a python program or python script.

Typos or suggestions?

If you've found a typo, a sentence that could be improved or anything else that should be updated on this blog post, you can access it through a git repository and make a pull request. If you feel comfortable with github, instead of posting a comment, please go directly tohttps://github.com/campelo/documentation and open a new pull request with your changes.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Fullstack developer | Using dev.to to sharing my experiences, studies and curiosities with you.
  • Location
    Québec, Québec
  • Education
    Bachelor's degree in computer science
  • Work
    Software engineer, entrepreneur
  • Joined

More fromFlavio Campelo

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp