How to Write your 1st Python Program (and Save your Script)? - Python Tutorial for Beginners

Опубликовано: 25 Октябрь 2024
на канале: Digital Academy
723
10

🎓 Welcome back to Digital Academy, the Complete Python Development Tutorial for Beginners, which will help you learn Python from A to Z!

🖥️ Write your first Python Program and Save your Python Code into a Script

You will eventually find it tedious to retype programs into your shell, line by line. Like other interpreted programming languages, you can store and execute Python code, from a file.

There are two main types of Python files: plain text, and bytecode files.

○ Plain text files are simple files that you can create and edit, with just a simple plain text editor. For instance: Notepad, Notepad++, or Python Integrated Development Environment.

○ The other type of file, bytecode files, are compiled Python files. Don't worry about this type of file for now, which will be discussed later on in this course.

A Python script file name ends with the extension ".py", and will be executable when you execute the script by itself, on most operating systems...

Create a file called "hello.py" and write the following code into it.

#!/usr/bin/python3
print("Hello world, from a Python script!")
input("Press enter to continue... ")

Now, run the script by either clicking on it, or by running it from your system's shell. Then the script should print "Hello world, from a Python script" and "Press enter to continue...", then it should pause until you press the Enter key!

Hello world, from a Python script!
Press enter to continue...

Congratulations, you wrote your first Python Script :)

Let's play this video, stick around and watch until the end of this video! 👍🏻

Digital Academy™ 🎓

***

📖 Blog: http://digital.academy.free.fr/blog

📖 [FULL Course] HOW TO Learn Python? Python Tutorial for Beginners:    • 🐍 Python 101: Learn Python Basics for...  

📖 [PLAYLIST] Complete Python Development Course for Beginners: http://digital.academy.free.fr/playli...

🧑‍🎓 [COURSE] Python for Absolute Beginners: http://digital.academy.free.fr/courses

📘 [BOOK] Python for Absolute Beginners: https://amzn.to/3NvyOWV

🛒 Shopping and Discounts: http://digital.academy.free.fr/store

💌 Weekly Newsletter for Developers: https://www.getrevue.co/profile/digit...

#Python #Tutorial #Beginners #Shorts

***

♡ Thanks for watching and supporting ♡
Please Subscribe. Hit the notification bell.
Like, Comment and Share.

***

♡ FOLLOW US ♡
✧ http://digital.academy.free.fr/
✧   / digitalacademyy  
✧   / digitalacademyfr  
✧   / digital_academy_fr  
✧    / digitalacademyonline  

♡ SUPPORT US ♡
✧ http://digital.academy.free.fr/join
✧ http://digital.academy.free.fr/store
✧ http://digital.academy.free.fr/donate
✧ http://digital.academy.free.fr/subscribe
✧   / digital_academy  
✧ https://www.buymeacoffee.com/digital_...

***