Lab 8: Difference between revisions

From Littlesvr Wiki
Jump to navigation Jump to search
(Created page with "= !!!THIS LAB IS NOT READY YET!!! = We only have time in this course for a basic introduction to programming using Python. Anyone who tells you that you can learn a programming language in a couple of days a week over two weeks is either an idiot or is lying to you, or both. We'll cram as much as we can in the time we have available. That's: basic concepts used in most programming languages, and a couple of practical examples of what you can do once you are ready to go...")
 
No edit summary
Line 2: Line 2:
We only have time in this course for a basic introduction to programming using Python. Anyone who tells you that you can learn a programming language in a couple of days a week over two weeks is either an idiot or is lying to you, or both.
We only have time in this course for a basic introduction to programming using Python. Anyone who tells you that you can learn a programming language in a couple of days a week over two weeks is either an idiot or is lying to you, or both.


We'll cram as much as we can in the time we have available. That's: basic concepts used in most programming languages, and a couple of practical examples of what you can do once you are ready to go beyond those basics.
We'll cram as much as we can in the time we have available. That's: basic concepts used in most programming languages, and some practical examples of what you can do once you are ready to go beyond those basics.


= Basic programming concepts =
= Basic programming concepts =
Python is a scripting programming language.
Python is a scripting programming language. That means you don't need to compile your programs before you run them. The Python interpreter will read your program and execute it step by step.
 
You will save your programs into plain text files with the .py extension. Like shell scripts: these can be executed using <code>./yourprogram.py</code> (if the file has execute permission) or by running <code>python yourprogram.py</code>


== Values and variables ==
== Values and variables ==

Revision as of 15:59, 30 March 2023

!!!THIS LAB IS NOT READY YET!!!

We only have time in this course for a basic introduction to programming using Python. Anyone who tells you that you can learn a programming language in a couple of days a week over two weeks is either an idiot or is lying to you, or both.

We'll cram as much as we can in the time we have available. That's: basic concepts used in most programming languages, and some practical examples of what you can do once you are ready to go beyond those basics.

Basic programming concepts

Python is a scripting programming language. That means you don't need to compile your programs before you run them. The Python interpreter will read your program and execute it step by step.

You will save your programs into plain text files with the .py extension. Like shell scripts: these can be executed using ./yourprogram.py (if the file has execute permission) or by running python yourprogram.py

Values and variables

Operators

Conditions and loops

Functions

Library functions & modules

Everything else

Programming is a profession. And even if you want to tackle it part-time (for example with the goal of being able to do do DevOps type of work): you will need to start using the programming language to accomplish tasks. You will immediately run into problems, and over time you will have no choice but to learn more and more details of this specifc programming language, and how more general systems work (the Linux kernel, TCP/IP, HTTP, unicode, databases, and so on until the end of time).

While that may sound daunting: I can assure you from personal experience that it's worth doing - both for personal gratification and financially. The more you learn: the more complex are the tasks you can accomplish. So every year you'll get better at it.

Shortcuts don't work for learning programming. Struggle, be stubborn, and good things will happen to you in the long run.

Examples