100% Correct Answers
What happens if you forget the colon after a loop? - Answer- Syntax error.
What happens if you forget to indent inside a loop? - Answer- Indentation error.
What happens if you indent unnecessarily after a loop? - Answer- Logic error (code runs
too many times).
What is a function in Python? - Answer- A standalone block of code that does not
belong to an object.
What is a method in Python? - Answer- A function that belongs to an object and is
called using dot notation.
Are strings mutable or immutable? - Answer- Immutable (methods return new strings).
What does \n do? - Answer- Creates a new line.
What does \t do? - Answer- Creates a tab (indent).
What symbols indicate a list in Python? - Answer- Square brackets [ ].
What index number represents the first element in a list? - Answer- 0.
What index accesses the last element? - Answer- -1.
What symbol connects an object to its method? - Answer- A dot (.)
Give an example of a standalone function. - Answer- print(), input(), len(), type()
Give an example of a method. - Answer- name.upper()
What does .upper() do? - Answer- Converts all characters in a string to uppercase.
What does .lower() do? - Answer- Converts all characters in a string to lowercase.
What does .title() do? - Answer- Capitalizes the first letter of every word.