Using String Formatting Methods
Using String Formatting Methods
.swapcase() - all characters of a string are made to switch case upper becomes
lower and vice versa
methods
.isalpha()
.isalnum()
.istitle()
.isdigit()
.islower()
.isupper()
.startswith()
print() can be called using arguments (or without) and sends text to standard
output, such as the console.
print() uses Parameters to define the variable Arguments that can be passed to
the Function.
print() can also be called directly with just its name and empty parenthesis and it
will return a blank line to standard output
define parameters
optional parameters
use a function name that starts with a letter or underscore (usually a lower-case
letter)
the code for the function is indented under the function definition (use 4 spaces for
this course)
def some_function():
type() has a parameter for a Python Object and sends back the type of the object
type("Hello")
Parameters are defined inside of the parenthesis as part of a function def statement
Parameters are typically copies of objects that are available for use in function code
def say_this(phrase):
print(phrase)
print(phrase)
type() can be called with a float the return value can be stored in a variable
object_type = type(2.33)
return double