Skip to content

Instantly share code, notes, and snippets.

View alwye's full-sized avatar
🏴

Alex alwye

🏴
  • Cisco
  • United Kingdom
View GitHub Profile
@alwye
alwye / main.py
Last active June 23, 2018 16:25
Simple script that illustrates Python's lists, functions and loops. Created for Cisco Software Engineering School.
def get_name(first_name, last_name):
print(first_name + " " + last_name)
friends = [
{
'first_name': 'Sherlock',
'last_name': 'Holmes'
},
{
@alwye
alwye / unittest.py
Created June 26, 2018 17:34
Example of a unit test
import unittest
def multiply(a, b, c):
return a * b * c + 1
class MathTest(unittest.TestCase):
def testMultiply(self):
@alwye
alwye / conditions.py
Created June 26, 2018 17:48
'Conditions' was the subject of the module 4. Here's different examples of how you use them.
# you can create a list like this
fruits = [
'apple',
'grapes',
'banana'
]
favourite_fruit = "mango"
if favourite_fruit in fruits: