Python Basics for Beginners | Python tutorial

  Рет қаралды 39,148

Dave Gray

Dave Gray

Күн бұрын

Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGrayWebDevRoadmap
In this step-by-step Python basics tutorial, you will learn the basics of the Python programming language. The tutorial covers Python variables, expressions vs statements, creates a program, and more!
💖 Support me on Patreon ➜ / davegray
⭐ Become a full-stack dev with Zero To Mastery Courses:
- The Complete Python Developer: bit.ly/CompPythonDev
- Complete Machine Learning & Data Science: bit.ly/CompMachineLearning
- Junior to Senior Dev Roadmap: bit.ly/WebDevRoadmap-JrtoSr
🚩 Subscribe ➜ bit.ly/3nGHmNn
📬 Course Updates ➜ courses.davegray.codes/
❓ Questions - Please post them to my Discord ➜ / discord
☕ Buy Me A Coffee ➜ www.buymeacoffee.com/davegray
👇 Follow Me On Social Media:
Github: github.com/gitdagray
Twitter: / yesdavidgray
LinkedIn: / davidagray
🔗 Source Code: github.com/gitdagray/python-c...
🔗 Playlist for this Python Course: bit.ly/dg-beginners-python
💡 UPDATE: The latest versions of VS Code no longer support the auto-formatting I demonstrated. That said, I did the research, and if you want this formatting behavior, I show you how to get it back here: www.davegray.codes/posts/how-...
Step-by-Step Python Basics Tutorial 🐍
(00:00) Intro
(00:05) Welcome
(00:13) Start the Python REPL
(01:06) Variables
(03:55) Expressions vs Statements
(05:08) Create a Welcome program
(08:09) Code Comments
(09:13) Python Indentations
📚 Tutorial References:
🔗 Python Official Site: www.python.org/
🔗Visual Studio Code Official Site: code.visualstudio.com/
Was this step by step Python basics tutorial for beginners helpful? If so, please share. Let me know your thoughts in the comments.
#python #basics #tutorial

Пікірлер: 121
@DaveGrayTeachesCode
@DaveGrayTeachesCode 7 ай бұрын
💡 Chapter 2 UPDATE: The latest versions of VS Code no longer support the auto-formatting I demonstrated. That said, I did the research, and if you want this formatting behavior, I show you how to get it back here: www.davegray.codes/posts/how-to-auto-format-unwanted-python-line-indents
@xyzxyz6095
@xyzxyz6095 7 ай бұрын
Thank you for the update,Dave.
@stian-A.K
@stian-A.K 6 ай бұрын
donno what im doing wrong here but its not auto formatting, i installed the extension autopep8 but it will not auto format the code when i save
@jumiclads
@jumiclads 6 ай бұрын
@@stian-A.K Me too, so your not alone.
@ameersalamah8143
@ameersalamah8143 5 ай бұрын
Not working for me either. I selected the autopep8 from the drop down menu and nothing happened. Someone pls help
@heiheihei6
@heiheihei6 5 ай бұрын
same here, after setting and confirm the code in settings.json, it doesn't work either save or formatting by right click..... why......
@xyzxyz6095
@xyzxyz6095 7 ай бұрын
Not only Dave is a good teacher but he also adds the keyboard shortcut to his speech. This is golden .Thank you Sir for sharing your knowledge with the rest of the world. Be Blessed. Salutations from France.
@jimjim8640
@jimjim8640 4 күн бұрын
autopep8 settings in VS Code have moved since this video. You need to search for and install the 'autopep8' extension (or another formatter). Then from the editor window (where you are compiling your code) right click and select "format document with..." this will open a selection where you can either select a formatter, e.g. autopep8 or assign/re-assign which formatter is used by default. Enjoy!
@alexanderkomanov4151
@alexanderkomanov4151 Жыл бұрын
Wow! That’s crazy man! Exactly what I’ve been waiting for!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@Ravikumar-pj4lc
@Ravikumar-pj4lc 7 ай бұрын
Hi Dave, thank you very much for sharing the knowledge. I couldn't find "Python>formatting" and provider. When I save the file, it does not automatically get corrected. Please help
@Microwaveoficial
@Microwaveoficial 24 күн бұрын
I had the same issue too Will keep you posted if I find a solution Edit: Apparently, this feature got removed on newer visual studio versions PS: I actually searched the whole internet but apparently a fellow commenter had found that it had been removed
@future-frank
@future-frank 10 ай бұрын
Hi, unable to find the autopep8 settings within version 2023.14.0 even after a search so has this been updated or changed to something else anyone please? 🙂
@ken-0098
@ken-0098 8 ай бұрын
Hey Dave! Ken here im just facing a small isuue with the vs code regaring the autopep8 which comes under the python extension somehow it says in the extension that it is installed but in the settings tab its not can u look into this?
@josephhlongwane6226
@josephhlongwane6226 21 күн бұрын
thanks, Dave....just what I need
@okonkwo.ify18
@okonkwo.ify18 Жыл бұрын
This series is like a refresher of the basics for me
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@Valdaur
@Valdaur Жыл бұрын
That was a pretty neat welcome message.
@sunnybhatti9567
@sunnybhatti9567 Жыл бұрын
Great job, Dave!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@Sunflower_Shinee
@Sunflower_Shinee 9 ай бұрын
I’m loving the videos
@dickschweiger289
@dickschweiger289 6 ай бұрын
very good. Downloaded your videos so i had to go through them here to give you thumbs up and a comment.
@akintobby
@akintobby Жыл бұрын
I've been patiently waiting😋. Good day sir✊
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@taegi_0613
@taegi_0613 8 ай бұрын
can anyone help me here? it says autopep8 is installed but it isn't running :( so when I click ctrl+S the file doesn't correct itself
@suminashrestha7267
@suminashrestha7267 8 ай бұрын
same problem
@Skullisho
@Skullisho 4 ай бұрын
I don't know if you saw, it said that vscode newest ver don't support it no more
@taegi_0613
@taegi_0613 4 ай бұрын
@@Skullisho thank you 😭 I was losing my mind trying to figure this out
@narenk8077
@narenk8077 Жыл бұрын
Can you please start the devops concepts as well
@khalilbenmeziane8836
@khalilbenmeziane8836 Жыл бұрын
thank you dave
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome!
@ahmad-murery
@ahmad-murery Жыл бұрын
Basic programming tutorials are the best, This welcome message brought back a lot of memories when BASIC language was a thing 😥 I think soon we'll be able to convert this example to a function that prints whatever message we feed it to. It really helped me calm my mind after some terrifying earthquakes. Thanks Dave,
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome! I hope you are doing well.
@danbromberg
@danbromberg 10 ай бұрын
'Python > Formatting:' ...is not to be found on my VS Python v1.81.1 ...what to do? A week later I found 'Python > Formatting:' under the WORKSPACE (not USER) tab, and then auto-indent started working. 🙂
@KalaniChen
@KalaniChen 3 ай бұрын
thanks a lot
@HaThuyNguyen-vs3zv
@HaThuyNguyen-vs3zv Ай бұрын
I haven't seen it in WORKSPACE. The onlything is "JSON:FORMAT". Please help me.
@laoying20
@laoying20 24 күн бұрын
hi thanks for your great teaching. I was trying to open the python road map link in your caption but the link didn't open for me. can I have the road map, please ?!
@bobjim5164
@bobjim5164 6 ай бұрын
Dude's teaching python and vscode at the same time! What a Chad!
@percyhider4267
@percyhider4267 Ай бұрын
the only options I see is to keep all existing lines open, nothing about autopep8 I have version 3.12.3 am I missing something?
@veryslon5104
@veryslon5104 Жыл бұрын
Thanks
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome
@lord-of-the-shinobi-world
@lord-of-the-shinobi-world Жыл бұрын
Just out of curiosity, which IDE do you think is better for Python programming? I am currently using Pycharm, but that thing is way too heavy and takes up a lot of space in my SSD. I am thinking of using other IDEs, such as Visual Studio Code here. I just do not know how to evaluate these two things
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Completely personal preference - I like VS Code.
@mortezafarhangpanah256
@mortezafarhangpanah256 Жыл бұрын
thanks
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@dharmeshgohil9375
@dharmeshgohil9375 Жыл бұрын
awesome dev
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@hamish7391
@hamish7391 Жыл бұрын
I am trying to use autopep8 and it is not working, and i keep trying to format manually, but that doesn't work either. Any tips?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Have you installed the Python extension I covered in lesson 1? If so and you are still having issues, here is the VS Code docs help for formatting in Python: code.visualstudio.com/docs/python/editing#_formatting
@iamwaiyanminhtet
@iamwaiyanminhtet Жыл бұрын
Hello Dave. Is this going to be a full course eventually? I’m just starting JavaScript and after that I have intention to learn Python. Moreover I like your explanations. Thanks.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Yes, it will take time to build, but it will be a full course eventually.
@paulmaxwell1395
@paulmaxwell1395 Жыл бұрын
Hi Dave i am pressing ctrl and s but it is not formatting my code like yours actually it dose nothing. i went through all the setting with you but it still dose nt work?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
1) Insure you have installed the Python extension for VS Code 2) Open VS Code settings and insure "Format On Save" is checked
@Valdaur
@Valdaur Жыл бұрын
I'm having the same problem, and I did everything the same as in the video.
@paulmaxwell1395
@paulmaxwell1395 Жыл бұрын
something is not right! when i click the format on save it dose not stay on ?? as soon as i move to out of settings the box gose unclicked? this is what come up at the bottom right of the terminal "Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again."?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
I have not experienced that with VS Code, but others may have. I suggest copying the error text and Googling it.
@MoreThanFuel
@MoreThanFuel 10 күн бұрын
my terminal doesnt have the dollar sign it instead starts with my C:\users\"my username> is that going to screw things up later? how do I fix this?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 9 күн бұрын
Sounds like you are using the Windows cmd terminal window. I was using a git bash terminal. Install git and you will have git bash if you want it to be just like mine.
@paulmaxwell1395
@paulmaxwell1395 Жыл бұрын
i have checked and python is installed?
@ronin_9
@ronin_9 8 ай бұрын
The auto formatting upon saving is not working. It is also not working when I right click and click on format document. Please help🙏🏻
@DaveGrayTeachesCode
@DaveGrayTeachesCode 8 ай бұрын
Don't use autopep8. Choose the default Python instead. If you have a .vscode folder in your file tree, delete it.
@ronin_9
@ronin_9 8 ай бұрын
@@DaveGrayTeachesCode I'm using default Python. How to delete the .vscode folder?(sorry for the stupid question I'm new to programming)
@DaveGrayTeachesCode
@DaveGrayTeachesCode 8 ай бұрын
@@ronin_9 only if you see that folder in your file tree. You would click on it and then press the delete key. It would hold workspace settings that would override your user settings.
@ronin_9
@ronin_9 8 ай бұрын
@@DaveGrayTeachesCode no such folder is there sir.
@nothing_justwatching3735
@nothing_justwatching3735 Жыл бұрын
Upload the remaining all topics of python and next.js . Eagerly waiting for that.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
It would be great if I could create them all that fast. I still have a full-time job and other responsibilities. I will continue to create the videos at the weekly pace which is currently something I can sustain. Glad you like them!
@stephenhammond1745
@stephenhammond1745 5 ай бұрын
Just getting started on Python. I have vsCode already installed (used it for your HTML/CSS course). Trying to get the formatter set up. I don't see anything in Settings for "python > formatting:"; in fact when I type ">" after python, almost everything disappears in the Settings window. I have the Python extension installed. I also don't see anything for formatting when I right-click in the editor window with a Python file open. Any ideas? PS. I do have the Prettier formatter installed which I used for HTML/CSS.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Pinned a comment on this.
@stephenhammond1745
@stephenhammond1745 5 ай бұрын
@@DaveGrayTeachesCodeThanks. I did see that post. The first part about clicking on the editor and selecting Format Document With...didn't work because there was no such item on the list. I finally just installed the autopep8 extension but had to disable Prettier before it would work, since it just kept reverting back to that as the default formatter. I didn't want to edit the .json file directly in case I did something wrong. Anyway, all good now but may install Black at some point.
@jamescaleb9676
@jamescaleb9676 3 ай бұрын
formatter is not automatically set up and python was not in my path when I set it up. it was a nightmare to make it work and now i don't want to use vs code.
@luuuuzr
@luuuuzr 3 ай бұрын
Yeah same for me here, totally frustratting, following step by step, not working, tried to also add autopep8 extensiun manually, still no luck.
@deepatterson1894
@deepatterson1894 3 ай бұрын
Don't have autopep8 is because I have newer version? doesn't auto fix...
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 ай бұрын
Read the pinned comment for an update.
@freeonfire0
@freeonfire0 Жыл бұрын
Who is operating system do you use
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
I believe I mentioned that I use Windows.
@jordanmatthew6315
@jordanmatthew6315 5 ай бұрын
Update Autopep8 is not working properly when i go into python > formatting: I only get my Json suggestion: Jason > format: Keep lines. Any ideas, anyone?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
There is a pinned comment for the new formatting directions in the documentation. You could also use black instead of autopep8. There are enough questions on this that I might make a KZbin short on it soon as well.
@jordanmatthew6315
@jordanmatthew6315 5 ай бұрын
@@DaveGrayTeachesCode My man, legend, thank you bro. :D
@jordanmatthew6315
@jordanmatthew6315 5 ай бұрын
@@DaveGrayTeachesCode P.s Looking forward to the short.
@utinthein7274
@utinthein7274 Жыл бұрын
Sir, after finished save file, indentation error not be gone. I already installed python extension. also setup in vs code formatonSave and autopep8.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
After installing, you may need to close and reopen VS Code.
@utinthein7274
@utinthein7274 Жыл бұрын
I'm so sorry. I can't Sir. I try to reinstall vscode.
@utinthein7274
@utinthein7274 Жыл бұрын
I got it Sir, I change in default formatter set up to "Python ms-python.python"
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you for sharing. I hope this helps others who may need it!
@utinthein7274
@utinthein7274 Жыл бұрын
🥰
@user-eh1qj8kv7q
@user-eh1qj8kv7q 11 ай бұрын
i followed all the format on save steps but it didnt work. pls help
@artyomtaranenko2267
@artyomtaranenko2267 10 ай бұрын
I think that work, but if u have syntax error, like few tabs, nothing work (black ore autopep8), its really hard after prettier (( First need fixed error, on video Dave formatted with error.
@dobingify3130
@dobingify3130 Жыл бұрын
i followed the settings in Python formatting, but still it can't auto format while saving the file
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You may need to close and reopen VS Code after installing the Python extension.
@dobingify3130
@dobingify3130 Жыл бұрын
@@DaveGrayTeachesCode nope, i solved it already by changing the default formatter from prettier to Python
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
@@dobingify3130 Good share. I did not need to do that
@taegi_0613
@taegi_0613 8 ай бұрын
@@dobingify3130 hi! if you don't mind can you help me on how to do this? I am very new to programming in general
@TakeElite
@TakeElite 8 ай бұрын
I did exactly what you have done but it absolutely won't work, any help.?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 8 ай бұрын
Might help to know specifically what won't work from this video. My guess is the formatting part which VS Code changed with an update. Follow the new directions for VS Code here: code.visualstudio.com/docs/python/formatting
@TakeElite
@TakeElite 8 ай бұрын
@@DaveGrayTeachesCode Thx for your reply, I fund my solution following another tutorial Black do the work and by the way learned about Json
@blackburn8323
@blackburn8323 5 ай бұрын
mine is not showing the autopep8
@DaveGrayTeachesCode
@DaveGrayTeachesCode 5 ай бұрын
Pinned comment addresses the formatting changes.
@imkir4n
@imkir4n Жыл бұрын
Dave wheres next js videos
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Fridays.
@phillipbones7522
@phillipbones7522 5 ай бұрын
as a blind person this video isn't too useful right now as I only use shortcut keys to get around, I tried my best to follow along but got stuck at the start of the video, typing py in the terminal doesn't do what the guy said, just an error
@LeonelLopezBorbon
@LeonelLopezBorbon Жыл бұрын
not more series this tutorial?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
New videos weekly and one released just a few minutes ago. 🚀
@LeonelLopezBorbon
@LeonelLopezBorbon Жыл бұрын
@@DaveGrayTeachesCode great!!
@Enkryption
@Enkryption Жыл бұрын
BAD TEACHING
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Final lessons for you as you collect a 100% full refund for this free tutorial: You will go further in life by being kind. You cannot elevate yourself by tearing down others.
@MC_Theophilus
@MC_Theophilus 7 ай бұрын
​@@DaveGrayTeachesCodedon't mind him/her for one second. Probably taking out his life frustrations on this generous and perfect course you've offered
@juanmayen6657
@juanmayen6657 6 ай бұрын
odd, my settings show indeed everything is set up '"window.zoomLevel": 2, "editor.accessibilitySupport": "off", "editor.fontSize": 14, "editor.formatOnSave": true, "[python]": { "editor.defaultFormatter": "ms-python.autopep8" }, "python.autoComplete.extraPaths": [' but upon saving nothing happens.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 6 ай бұрын
Look at the pinned comment for this video or in the video description for an update on the formatting.
@willyhorizont8672
@willyhorizont8672 Жыл бұрын
dave_tutorial = "🚀🚀🚀🚀" python_programming_language = "🚀🚀🚀🚀" comment = date_tutorial + python_programming_language print(comment) # 🚀🚀🚀🚀🚀🚀🚀🚀
Python Operators for Beginners | Python tutorial
17:01
Dave Gray
Рет қаралды 21 М.
$10,000 Every Day You Survive In The Wilderness
26:44
MrBeast
Рет қаралды 133 МЛН
小女孩把路人当成离世的妈妈,太感人了.#short #angel #clown
00:53
Кәріс өшін алды...| Synyptas 3 | 10 серия
24:51
kak budto
Рет қаралды 1,3 МЛН
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 176 МЛН
5 Good Python Habits
17:35
Indently
Рет қаралды 367 М.
How to Make Your Python Code More Modular and Reusable
7:01
The Code Guy
Рет қаралды 13 М.
20 Programming Projects That Will Make You A God At Coding
14:27
The Coding Sloth
Рет қаралды 423 М.
C++ Developer Learns Python
9:26
PolyMars
Рет қаралды 2,7 МЛН
Python Tutorial for Beginners with VS Code 🐍
13:56
Dave Gray
Рет қаралды 178 М.
Python for Beginners - Learn Python in 1 Hour
1:00:06
Programming with Mosh
Рет қаралды 17 МЛН
The Truth About Learning Python in 2024
9:38
Internet Made Coder
Рет қаралды 122 М.
VSCode's Python Interactive mode is AMAZING!
6:58
Jack of Some
Рет қаралды 345 М.
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,5 МЛН
$10,000 Every Day You Survive In The Wilderness
26:44
MrBeast
Рет қаралды 133 МЛН