Lab 4 (Indentation, String, Tuples, Modules, File I_O)(3).pdf - Lab 4(Indentation String Tuples Modules File I\/O Main Functions with Strings Main

Lab 4 (Indentation, String, Tuples, Modules, File I_O)(3).pdf

This preview shows page 1 - 8 out of 12 pages.

Z[¿À¿×Ø× 4 (RnßÞãânt¿À¿tĄon, trĄnùø, upęãâs, aoßÞuęãâs, EĄęãâ R/he) ̆͌ץ̅͌ע̂נ̀ע̂נ̀
Image of page 1
oain Munctions with Strings
Image of page 2
oain Munctions with A.ictionaries
Image of page 3
0. (Strings Review) Mormatting ,index, slicing, and methods ± = “How are you today?” What would be each of the outputs? len(±) = ? ±[0] = ? ±[:7] = ? ±[10::-2] = ? ±[9] = “Y”, print(±) ±.find(“o”) = ? ±.split(“ ”) = ? ±.islower() = ? print(“My name is {1} and I am an {0} ”.format(“eagle”, “2 lawed”))
Image of page 4
Question 0.5 : A.ictionary Munctions (Review) YSSTZZ[XRRS<>YYZZZ[OIIPJJYSSTYYZXXY'#``a $?:SnSNvOJrsSNtSNOJs$ $ DF $>?:$ ° $?:7A$ ° [email protected]?:>$ FH° $>?:$ $ ±²³ ± ° $?:7A$ $ ´³µ¶± ° $*A<$ $ ¶µ ±² ° $*>$ $ ´µ¶² ° [email protected]?:>$ $ ## bc ±. numStudents.clear() 1. print(numStudents.keys()) 2 . print(numStudents.items()) 8&. del numStudents['Q?GT'] <*. print(numStudents[‘±U’]) P>F. numStudents[‘Q?GW’]+=1000 print(numStudents) ITWW P LS SZZRBYYZZSHSYYXX%" UUWWLSYY±P²
Image of page 5
1. A.uplicate getters Write a function, duplicates, that takes two strings as parameters and returns a string of the letters that appear in both strings ( m¿À¿ĕãâ surãâ ęãâttãârs ßÞo not rãâpãâ¿À¿t Ąn nãâw strĄnùø ). <*x: Str1 = “cupcake” Str2 = “clockwise” Output: “cke”
Image of page 6
#2 ;reating a Username:
Image of page 7
Image of page 8

You've reached the end of your free preview.

Want to read all 12 pages?

  • Spring '14
  • Black,M
  • Tuple, len, Currying

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes