• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/13

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

13 Cards in this Set

  • Front
  • Back
strings
Strings are, well, strings of characters, which is a more formal way of saying they're really just regular English phrases.
escaped
marked as unique
method
A method is a function of a specific object. A function is a piece of code that solves a particular problem or performs a specific task. For now, the takeaway is that string methods are pre-built pieces of code that perform specific tasks for strings.
len()
returns the length—that is, the number of characters—of the string on which it's called.

example: len(parrot)
lower()
returns a lower-cased output of the string

example: parrot.lower()
upper()
returns an upper-case output of the string

example: parrot.upper()
str()
The str() method returns a string containing a nicely printable representation of whatever you put between the parentheses.

example: str(pi)
dot notation
Dot notation works on string literals ("The Ministry of Silly Walks".upper()) and variables assigned to strings (ministry.upper()) because these methods are specific to strings—that is, they don't work on anything else. By contrast, len() and str() can work on a whole bunch of different objects (which we'll get to later), so they can't be tied just to strings with dot notation.
print
prints the result of the interpreter's evaluation of your code to the console for you to see.

example: print "monty_python"
concatenate
brings strings together using the + sign

example: "Monty " + "Python" will return "Monty Python"
explicit string conversion
using the str() method to convert non-strings into strings
implicit string conversion
putting quotes around a sequence of characters to make it a string
sting formatting

(%s)
name = raw_input("What is your name?")
quest = raw_input("What is your quest?")
color = raw_input("What is your favorite color?")

print "Ah, so your name is %s, your quest is %s, \
and your favorite color is %s." % (name, quest, color)