Basic Python course
From scratch: everything you need to write your first programs. In DMarlon Studio, Python powers desktop apps (tkinter), Flask websites and the console: design the window and the studio writes the Python code.
Start- 1Hello, worldYour first Python program: print() writes text and results to the console. Run it with one click in DMarlon Studio.Lesson 1
- 2Variables and typesStore data in Python variables and find out their types (str, float, int and bool) with type(), using a small shop as the example.Lesson 2
- 3Numbers and arithmeticDo maths in Python: whole division with //, remainders with %, powers with ** and rounding with round(), while sharing out some pizzas.Lesson 3
- 4Strings and f-stringsWork with text in Python: join and repeat strings, count characters with len(), read positions and format values with f-strings.Lesson 4
- 5Reading from the keyboardAsk the user for data with input() in Python and convert it into numbers with int() and float() so you can do maths with it.Lesson 5
- 6Deciding with if, elif and elseMake your Python program take decisions with if, elif and else: what to wear for the weather and whether delivery is free.Lesson 6
- 7Comparisons and logicCompare values in Python with ==, !=, < and >=, and combine conditions with and, or and not to decide who rides the roller coaster.Lesson 7
- 8Repeating with whileRepeat code in Python with while as long as a condition holds: save up for a bike week by week and run a countdown.Lesson 8
- 9For loops and range()Loop over letters and numbers with for and range() in Python: a times table, Olympic years, a running total and break to stop early.Lesson 9
- 10ListsKeep several values in a Python list: read them by position, change them, loop over them with for and add them up with sum(), min() and max().Lesson 10
- 11Working with listsAdd, remove and sort the items of a Python list with append, insert, remove, pop and sort, and take parts of it with slicing [a:b].Lesson 11
- 12Tuples and unpackingUse Python tuples for data that does not change, and unpack them into several variables at once, even inside a for loop.Lesson 12
- 13DictionariesStore key-value pairs in a Python dictionary: a greengrocer's stock with get(), del, items(), keys() and values().Lesson 13
- 14SetsRemove duplicates with Python sets and compare groups with intersection, union and difference: who belongs to each school club.Lesson 14
- 15FunctionsCreate your own Python functions with def, pass them data and send results back with return, while printing a café's receipts.Lesson 15
- 16Parameters, defaults and returnGive default values to the parameters of your Python functions, call them by name and send back several results with return.Lesson 16
- 17String methodsClean up and transform text in Python with strip, split, join, lower, upper, replace, find and count, tidying a list of ingredients.Lesson 17
- 18Errors with try and exceptCatch the errors in your Python program with try and except so it keeps going: bad numbers, division by zero and missing keys.Lesson 18
- 19Writing and reading filesSave data to a text file with Python and read it back with open(), write() and read(): the high scores of a game.Lesson 19
- 20Project: grade reportA project that brings the basic Python course together: it reads marks from a file, skips bad data and prints a report with averages and grades.Lesson 20