Compsci 101 101 Introductio ion Live L Lectu ture re Susan - - PowerPoint PPT Presentation

compsci 101 101 introductio ion live l lectu ture re
SMART_READER_LITE
LIVE PREVIEW

Compsci 101 101 Introductio ion Live L Lectu ture re Susan - - PowerPoint PPT Presentation

Compsci 101 101 Introductio ion Live L Lectu ture re Susan Rodger sum(lst) sum of the elements in lst September 8, 2020 maximum value of lst max(lst) min(lst) minimum value of lst .append(elm) Mutates the list by adding elm to the


slide-1
SLIDE 1

Compsci 101 101 Introductio ion Live L Lectu ture re

9/8/2020 Compsci 101, Fall 2020 1

Susan Rodger September 8, 2020

sum(lst) sum of the elements in lst max(lst) maximum value of lst min(lst) minimum value of lst .append(elm) Mutates the list by adding elm to the end

  • f the list

.count(elm) Number of times see elm in the list

slide-2
SLIDE 2

Announcements

  • Assig

ignm nment nt 1 Totem em d due Thur Thur, S Sep ept 10, 10, 11:30 11:30pm

  • Also REFLECT Form due same time
  • APT

APT-2 o 2 out t today, , due ue Tue ue, S Sep ept 15 15

  • Extens

nsio ion f n form o

  • n the course w

e websit

  • ite. (Forms

rms t tab)

  • Sickness or Athlete traveling
  • Sick, must fill out incapacitation form
  • Exam

am in in ab about ut t two w week eeks

  • Send in SDAO letter now

9/8/2020 Compsci 101, Fall 2020 2

slide-3
SLIDE 3

PFTD

  • Lists c

continued inued

  • String

ing m metho hods a and m more

9/8/2020 Compsci 101, Fall 2020 3

slide-4
SLIDE 4

WOTO-1 Cloning http://bit.ly/101f20-0908-1

  • In

In you

  • ur g

grou

  • ups:
  • Come to a consensus

9/8/2020 Compsci 101, Fall 2020 4

slide-5
SLIDE 5

WOTO-2 – Mutable http://bit.ly/101f20-0908-2

  • If you

u ar are d e done ear ne early, t thi hink ab about t the m he mud uddiest point int s so far ar and and a ask m me e or on n Pia iazza

  • In

In you

  • ur g

grou

  • ups:
  • Come to a consensus

9/8/2020 Compsci 101, Fall 2020 5

slide-6
SLIDE 6

WOTO-3– List Append http://bit.ly/101f20-0908-3

  • Try d

drawing it it out ut if if you u ar aren en’t s sur ure!

  • In

In you

  • ur g

grou

  • ups:
  • Come to a consensus

9/8/2020 Compsci 101, Fall 2020 6

slide-7
SLIDE 7

WOTO-4 – Split and Join http://bit.ly/101f20-0908-4

  • If you a

u are d e done ne early, think nk o

  • f the m

e muddies est p point nt and ask sk me me or

  • r on
  • n P

Piazza!

  • In your

ur g group ups:

  • Come to a consensus

9/8/2020 Compsci 101, Fall 2020 7

slide-8
SLIDE 8

More Methods

St Stri ring

.find(s) index of first

  • ccurrence of s

.rfind(s) index of last occurrence

  • f s (from Right)

.upper()/ .lower() uppercase/lowercase version of string .strip() remove leading/trailing whitespace .count(s) number of times see s in string .startswidth(s) bool of whether the string begins with s .endswidth(s) bool of whether the string ends with s

List

sum(lst) sum of the elements in lst max(lst) maximum value of lst min(lst) minimum value of lst .append(elm) Mutates the list by adding elm to the end

  • f the list

.count(elm) Number of times see elm in the list

9/8/2020 Compsci 101, Fall 2020 8