Class 08 – Friday February 19

I know that or now I know that, that is the question

We are humankind — What a mantra that could be — I'm human and kind

Got Covid Vaxed — The day before yesterday — Hug family soon.


Look both ways


What I want to accomplish today


Downloads

 

 


To do list


Program love_is_all_you_need.py

Enter number of lines to be printed: 5

Love is all you need

Love is all you need

Love is all you need

Love is all you need

Love is all you need

Enter number of lines to be printed: 1

Love is all you need

Enter number of lines to be printed: 0



Program thats_amore.py

Enter text: love amore salanghae

love

amore

salangha

Enter text: upendo grá cinta Ai

upendo

grá

cinta

Ai



Program kinda_stringy.py

Enter a string: four score

f

o

u

r

s

c

o

r

e

Enter a string: and seven years

a

n

d

f

o

u

r

y

e

a

r

s



Problem solving — program prowess.py

Enter text: Hoos got your back

Input length: 18

Index of last input character: 17

Last character in text: k

Enter text: Enter text: And the winner is ...

Input length: 21

Index of last input character: 20

Last input character: .



Program case_by_case.py

Enter text: thanks VERY mucH.

text: thanks VERY mucH.

text.lower(): thanks very much. # all lower case

text.upper(): THANKS VERY MUCH. # all upper case

text.capitalize(): Thanks very much. # initial character capitalized, rest lower case



Program countability.py

Enter text: any bananas

Enter substring: an

Enter index: 7

text.count( substring ): 3 # count all

text.count( substring, 7 ): 1 # count starting from index 7



Program find_the_spot.py

Enter text: aardvark

Enter substring: a

text.find( substring ): 0 # first occurrence

text.find( substring, 1 ): 1 # second occurrence

text.find( substring, 2 ): 5 # third occurrence



Program replacement.py

Enter text: yellow bellied sapsucker

Enter substring (s): ll

Enter substring (r): L L

text.replace( s, r ): yeL Low beL Lied sapsucker # text's s's replaced with r's

Enter text: yellow bellied sapsucker

Enter substring (s): e

Enter substring (r):

text.replace( s, r ): yllow bllid sapsuckr # text's s's replaced with r's




{{Information |Description=Whitecliffs, Canterbury, New Zealand |Source=flickr.com ([http://www.flickr.com/photos/flissphil/148026511/]) |Date=16 May 2006 |Author=Phillip Capper |Permission= |other_versions= }}


vaccination covid

 


  🦆 © 2022 Jim Cohoon   Resources from previous semesters are available.