Introduction to Python Programming
Python, med dess många tillämpningsområden, har blivit ett allt mer populärt språk. Under den här kursen lär du dig att skriva och underhålla Python-script.
Många kurser kan även betalas med vårt kompetenskort alternativt utbildningsvouchers eller motsvarande credits från någon av våra teknikpartners.
Boka utbildning
Du lär dig alla viktiga grunder, som syntax, variabler, datatyper, operatorer och uttryck, loopar, villkorssatser och mycket annat användbart. Kursen innehåller många övningar där du får tillämpa kunskaperna praktiskt.
Målgrupp och förkunskaper
Den här kursen riktar sig till dig som vill komma igång med Python. Kursen är också lämplig för IT-tekniker som vill lära sig Python för att använda det till systemadministration.
Viss vana av programmering är en fördel.
För att alltid hålla en hög kvalitet på våra teknikkurser använder vi både engelsk- och svensktalande experter som kursledare
Detaljerad information
Kursmaterialet är på engelska, med detta innehåll:
Python Basics
This module explains how to get started using Python.
- Getting Familiar with the Terminal
- Running Python
- Running a Python File
- Literals
- Variables
- Constants and Deleting Variables
- Writing a Python Module
- print() Function
- Collecting User Input
- Reading from and Writing to Files
Functions and Modules
You have seen some of Python’s built-in functions. In this lesson, you will learn to write your own.
- Defining Functions
- Variable Scope
- Global Variables
- Function Parameters
- Returning Values
- Returning Values
- Importing Modules
- Methods vs. Functions
Math
Python includes some built-in math functions and some additional built-in libraries that provide extended math (and related) functionality. In this lesson, we’ll cover the built-in functions and the math and random libraries.
- Arithmetic Operators
- Assignment Operators
- Precedence of Operations
- Built-in Math Functions
- The math Module
- The random Module
Python Strings
This module explains how to work with Python Strings.
- Quotation Marks and Special Characters
- String Indexing
- Slicing Strings
- Concatenation and Repetition
- Combining Concatenation and Repetition
- Python Strings are Immutable
- Common String Methods
- String Formatting
- Formatted String Literals (f-strings) (introduced in Python 3.6)
- Built-in String Functions
Iterables: Sequences, Dictionaries, and Sets
Iterables are objects that can return their members one at a time. The iterables we will cover in this lesson are lists, tuples, ranges, dictionaries, and sets.
- Definitions
- Sequences
- Lists
- Sequences and Random
- Tuples
- Ranges
- Converting Sequences to Lists
- Indexing
- Slicing
- min(), max(), and sum()
- Converting between Sequences and Strings
- Unpacking Sequences
- Dictionaries
- The len() Function
- Sets
- *args and **kwargs
Virtual Environments
A virtual environment provides a self-contained directory tree with its own Python installation and additional packages necessary for the project(s) being done in that environment. As such, scripts can be run in a virtual environment that have dependencies that are different from those in other development projects that may be running in the standard environment or in separate virtual environments.
- Packages with pip
Flow Control
This module explains how to change the flow by using conditional statements and loops.
- Conditional Statements
- Compound Conditions
- The is and is not Operators
- all() and any() and the Ternary Operator
- In Between
- Loops in Python
- break and continue
- Looping through Lines in a File
- The else Clause in Loops
- The enumerate() Function
- Generators
- List Comprehensions
Exception Handling
This module explains how to anticipate and handle exceptions gracefully.
- Exception Basics
- Generic Exceptions
- The else and finally Clauses
- Using Exceptions for Flow Control
- Raising Your Own Exceptions
Python Dates and Times
This module explains how to use Python’s built-in modules to work with dates and times.
- Understanding Time
- The time Module
- Time Structures
- Times as Strings
- Time and Formatted Strings
- Pausing Execution with time.sleep()
- The datetime Module
- datetime Objects
- timedelta Objects
File Processing
This module explains how to process files.
- Opening Files
- Writing to Files
- The os Module
- walk()
- The os.path Module
- A Better Way to Open Files