Svavar Konráðsson - Fab Futures - Data Science
Home About

< Home

Class 1: Playground¶

I'm planning to analyze a few different types of data during this class. I'll try to access the API of a solar cell that is being set up here at the secondary school in Ísafjörður. I'm going to see what kind of open data I can find from the Icelandic government. I would also like to get some sensor data and try a bit of machine vision.

But first of all, I need to get acquainted with Python.

Python practice¶

Fastest way to learn Python - Python Crash Course - Episode 1

In [1]:
print('Hello world!')
Hello world!

Variables and strings - Python Crash Course - Episode 2

In [2]:
message = 'Hello "Python"!'
print(message)
message = "Hello 'Python'!"
print(message)
Hello "Python"!
Hello 'Python'!
In [3]:
for i in range(4):
    message = i+1
    print(message)
1
2
3
4
In [4]:
name = 'ada lovelace'
print(name)
print(name.title())
print(name.lower())
print(name.upper())
ada lovelace
Ada Lovelace
ada lovelace
ADA LOVELACE
In [5]:
first_name = "Ada"
last_name = "Lovelace"
print(f'Hello, {first_name} {last_name}. Nice to meet you.')
Hello, Ada Lovelace. Nice to meet you.
In [12]:
favorite_language = "Python   "
print(favorite_language)
print(favorite_language.rstrip())
Python   
Python
In [7]:
other_language = "   C"
print(other_language.lstrip())
print(other_language)
other_language = other_language.lstrip()
print(other_language)
C
   C
C