To Lecture Notes

IT 212 -- Oct 5, 2020

Review Exercises

  1. What is the output?
    a = ['club', 'diamond', 'heart', 'spade']
    print(a[0][3], a[0][1], a[0][2], a[2][1], \
        sep='', end=' ')
    print(a[1][0], a[3][4], a[1][3], a[1][4], \
        a[1][5], a[3][0], sep='')
    
    Ans: blue demons. The first index is the string in the list. The second index is the letter in that string.
  2. Work in Zoom breakout groups of 3 or 4 to design a BankAccount class. Think of instance variables and methods for a BankAccount class. Come up with about 8 instance variables and 5 instance methods.
    Ans: Here are composite lists of BankAccount instance members that the breakout groups obtained:
    Instance Variables: acct_number name balance email pin interest acct_type
    Instance Methods: deposit withdraw add_interest __init__  __str__

The repr Method

A List of Card Objects

Sorting

What are __name__ and __main__?

Project 3a