Changes

Jump to navigation Jump to search

Workshop: Introduction to programming (with Python)

358 bytes added, 20:13, 3 October 2019
Welcome to Introduction to Programming!
{{Workshop header}}
 
=== Python ===
Some Beginner Questions:
 
* What do you know about Python?
* Do you have any previous experience with Python or other programming languages?
 
 
Python Basics:
 
* Python is a flexible, high-level, procedural scripting language.
* It offers support for object-oriented programming and integrating libraries.
* It's super widely adopted!
 
<br />
==Welcome to Introduction to Programming!==
##To iterate a certain number of times - Use Python's range function to repeat the code block a certain number of times. The syntax for range is: range (start, stop[, step]). Just like in the other type of for loop, you can reference each element of the range function but naming it. The syntax for this for loop goes: '''for ('''element '''in range('''start, stop[, step]''')):''' '''''*code to repeat*''''' <br />
#'''Nested Loops''' - Loops can be nested inside of each other! For each iteration of the outer loop, the entire contents of the loop will be ran to completion (including other nested loops).
#'''Breaks and Continues''' - "Break" and "continue" are statements which can be placed inside of a loop to modify the loop for special cases. Break is used to break out of (or exit) a loop. Continue is used to stop the current iteration of the loop and start again from the beginning.
118
edits

Navigation menu