Starting from:

$30

An Introduc3on to the Lab Environment

ITI    1120    
Lab    #    1    
    An    Introduc3on    to    the    Lab    
Environment
1
About    TA    (Teaching    Assistant)    …    
• Name:        
• E-mail:        
• Office    hour:        TBA    
2
Objec>ves
• GeAng    familiar    with    the    lab    environment    
– Logging    In    and    Logging    Out    
– Notable    Features    
– E-Mail    
– Blackboard    Learn    
• Crea>ng    and    SubmiAng    a    Prac>ce    Assignment    0    
• Your    first    python    program        
• Two    exercises        
• Bonus    exercise
3
Logging    in    and    Logging    out
LOG    IN:    
Follow    the    instruc>ons    on    the    screen    to    log    in.    In    par>cular:    
• Use    your    uoACCESS    accounts    to    authen>cate,    which    is    the    same    account    
used    for    Gmail,    Google    Docs    and    Eduroam.    For    example,    if    your    student’s    
email    is    jdoe123@uO\awa.ca,    you    will    specify    the    username    ‘jdoe123’    
and    use    your    uoACCESS    password.    
LOG    OUT:        
• When    you    are    all    done    and    ready    to    leave,    the    last    thing    you    ALWAYS    do    
is    to    log    out.    Another    student    could    have    access    to    your    files    if    you    do    not    
log    out.        Do    not    turn    the    power    off    a`er    logout,    leave    the    power    on.    
4
University    Email
Your    university    email    is    powered    by    Google.    
To    sign    up    for    a    Google    Apps    account,    log    into    uoZone
from    the    student    portal        
    h\p://uO\awa.ca/students
and    click    on    Email    management    in    Key    applica>ons    on    
the    right    hand    side    of    the    homepage.    
Accessing    BlackBoard    Learn    
• What    is    at    BlackBoard    Learn?     – All    the    course    material    is    there    (think    of    it    as    the    course    web    page)    
– Downloading    and    submiAng    assignments    
– Announcements    
– Consul>ng    your    grades.        
– Discussion    group    
– Students    are    required    to    check    the    Blackboard    Learn    and    their    O\awaU
email    frequently    for    announcements    and    all    material.    
• To    access    BlackBoard    Learn:     – Go    to    h\ps://uo\awa.blackboard.com/    
– Enter    your    InfoWeb    user    name    and    password    and    Sign    In.    
– Click    on    ITI1120    to    access    the    course
6
Star>ng    Lab    1    
• Open    a    browser    and    log    into    Blackboard    Learn    
• On    the    le`    hand    side    under    Labs    tab,    find    lab1    material    
contained    in    lab1-students.zip    file    
• Download    that    file    to    the    Desktop    and    unzip    it.
7
Star>ng    Lab    1    
• Open    the    file    provided    with    this    lab    called    OpeningIDLE.pdf
• Follow    the        5    steps        described    in    OpeningIDLE.pdf
• Then    type    1+2*3,    press    enter    and    observe    the    output    
• Then    type    (1+2)*3,    press    enter    and    observe    the    output    
• Then    type    in    the    expression    that    sums    first    5    posi>ve    integers    
• Then    type    the    expression    that    finds    average    of    25,    12,    40    and    1    
8
9
Submit    Assignment    0
• Prac>ce    Assignment    0:    
– Open    the    file    provided    with    this    lab    called    UsingIDLE-first-program.pdf
– Follow    the    10    steps    to    create    Python    program    a0_xxxxxxx.    py and    place    it    in    
the    folder    you    crated    called    A0_xxxxxxx.                    
                    (Note    that    what    you    see        on    your    computers    may    differ    slightly    from    that    what    
you    see    in    UsingIDLE-first-program.pdf)    
– Right-click    on    the    A0_xxxxxxx    folder    and    then    select    “Add    to    A0_xxxxxxx.zip”.            
• This    will    create    a    zip    file    with    the    contents    of    the    directory.
• Go to BlackBoard Learn
– Find and open Assignment 0
– Upload your zip assignment file.
– ATTENTION: the assignment has not yet been submitted.
– Click on the button “Submit”.
– You will see a confirmation that the assignment has been submitted.
Iden>fica>on
• The    following    informa>on    must    be    included    at    
the    beginning    of    each    program    in    your    future        
assignments.    For    example,    in    Assignment    1,    
your    program    a1_xxxxxxx.    py     must    start    with:    
# Course: IT1 1120
# Assignment number
# Family name, Given name
# Student number
Finishing    up    with    lab    technicali>es
• When    you    log    out    from    a    lab    computers,    the    files    and    
folders    you    created    will    disappear.    Thus    if    you    need    
them    copy    them    to    a    USB    memory    s>ck    before    
logging    out.
• When    you    are    ready    to    leave,    double-click    on    the    
logout    icon.        Do    not    turn    off    the    power.    
• But,    before    logging    out    …    complete    the    following    tasks
11
Turtle    Program    Example         
• Start    IDLE    
• The    material    you    downloaded    for    Lab    1    has    a    Python    program    in    a    
file    called    turtle_smiles.py
• Open    that    file    with    IDLE    
• Press    Run    Module    and    observe    what    happened.        
• Now    study    the    code    and    the    following    two    slides    before    a\emp>ng    
to    do    Exercise    1    (explained    in    3rd    slides    from    here)    
• No>ce    the    lines    in    turtle_smiles.py that    start    with    #.    All    
lines    star>ng    with    #    will    be    ignored    by    python    interpreter        when    
your    press    run.    Therefore    I    used    #    to    explain    parts    of    the    program    
to    you.
12
Useful    func>ons    in    Turtle    Class         
This table is from “Introduction to Computing Using Python” by Lj. Perkovic 13
Useful    func>ons    in    Turtle    Class
14 This table is from “Introduction to Computing Using Python” by Lj. Perkovic
Exercise    1         
• From    IDLE    open    file    turtle-ex1.py    that    is    provided    with    Lab    1.        
• Add    your    own    code    inside    of    that    file    so    that    your    final    program    draws    a    dart    
board    similar    to    the    one    depicted    below.    (no    need    to    use    loops.    copy/paste    is    
your    friend).    Do    not    forget    that    whenever    you    make    changes    to    a    file    you    
have    to    save    it    first        
                        before    you    can    run    it.        
15
Exercise    2         
• From    IDLE    open    file    turtle-ex2.py    that    is    provided    with    Lab    1.        
• Add    your    own    code    inside    of    that    file    so    that    your    final    program    draws    an    
image    similar    to    the    one    depicted    below.    (no    need    to    use    loops.    copy/paste    is    
your    friend).    Place    your    code    where    indicated    in    file    turtle-ex2.py    
16
Having    fun        
Bonus:    Write    a    program    in    Blockly
• What    is    Blockly:    visual    programming    language    
developed    by    Google    (to    help    students    learn    
programming)    
• Instruc>ons    are    blocks    that    fit    together    (like    
lego    bricks)    to    make    up    a    computer    program.        
17
Bonus    Exercise        
• Use    Blockly    to    solve    level    9    and    10    mazes    here:        
h\ps://blockly-games.appspot.com/maze?lang=en&level=9&skin=0    
h\ps://blockly-games.appspot.com/maze?lang=en&level=10&skin=0
- To    get    an    idea    on    how    to    solve    them    (i.e.    how    to    program    in    
Blockly,    you    many    need    to    solve    a    few    earlier    levels)    
- Try    to    find    solu>ons    with    the    smallest    possible    number    of    blocks    
- Challenge:        Can    you    solve    level        9    with    4    blocks.    What    about    Level    
10    with    6!!    
18