• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 7 páginas
Examen

COSC Exam 2 Study Guide 2026/2027 | 50+ Python Questions & Answers | Functions, String Methods, Lists, Sorting, Loops, Range & Accumulators

Document preview thumbnail
Vista previa 2 fuera de 7 páginas

This COSC Exam 2 Study Guide 2026/2027 contains 50+ exam questions and answers across 7 pages, providing a focused review of essential Python programming concepts. The material begins with the distinction between functions and methods, dot notation, and common standalone functions such as print(), input(), len(), and type(). It then provides extensive practice with Python string methods, including .upper(), .lower(), .title(), .capitalize(), .strip(), .lstrip(), .rstrip(), .startswith(), .endswith(), .find(), .count(), .replace(), .split(), and .join(). The strings section also reinforces important concepts such as string immutability, substring searching, index positions, replacement operations, whitespace removal, and escape sequences including n for a new line and t for a tab. These questions help students distinguish closely related string methods and understand what each method returns or changes. A substantial section focuses on Python lists and list manipulation. Students review square-bracket list syntax, zero-based and negative indexing, modifying list elements, .append(), .insert(), del, .pop(), and .remove(). Sorting receives particularly detailed coverage through .sort(), sorted(), reverse sorting, .reverse(), sorting with key=len, case-insensitive sorting using , lambda-based sorting by the last character, and ASCII ordering of numbers, uppercase letters and lowercase letters. The final portion covers Python iteration, loops and ranges. Questions explain the purpose and syntax of for and while loops, how range() determines starting, stopping and step values, and how to count backward using a negative step. The guide concludes with the accumulator pattern, initialization of running totals, len(), and common programming mistakes involving missing colons, incorrect indentation and unnecessary indentation. Overall, this resource provides a concise but targeted review for COSC Exam 2, particularly for an assessment emphasizing Python strings, lists, methods, iteration and fundamental programming syntax. The question-and-answer structure makes it suitable for self-testing, rapid revision and reinforcing the expected behavior of commonly used Python operations. Relevant Students: COSC students preparing for Exam 2, introductory Python programming students, first-year computer science students, programming fundamentals students, students learning Python strings and lists, and learners preparing for assessments covering functions, methods, sorting, loops, ranges, accumulators and common Python syntax errors. Keywords: COSC Exam 2 Study Guide , COSC Exam 2 questions and answers, COSC Exam 2 review, 50 Python questions and answers, Python Exam 2, Python study guide, Python programming exam, introductory Python questions, Python functions, Python methods, Python dot notation, Python string methods, upper lower strip Python, startswith endswith, Python find method, Python replace method, Python split and join, string immutability, Python lists, list indexing, append insert pop remove, Python list sorting, sort vs sorted Python, reverse sorting Python, lambda sorting, ASCII sorting, Python for loop, Python while loop, Python range function, range start stop step, Python accumulator, Python len function, Python syntax error, Python indentation error, programming fundamentals exam

Vista previa del contenido

COSC Study Guide Exam 2
2026/2027 Exam Questions and
Answers | A+ Score Assured



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.


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.


What does .capitalize() do? - ANSWER ✔✔Capitalizes only the first

letter of the string and makes the rest lowercase.


What does .strip() do? - ANSWER ✔✔Removes whitespace from

both beginning and end of a string.


What does .lstrip() do? - ANSWER ✔✔Removes whitespace from the

left side only.


What does .rstrip() do? - ANSWER ✔✔Removes whitespace from the

right side only.


What does .startswith("text") return? - ANSWER ✔✔True or False

depending on whether the string starts with the given text.

Información del documento

Subido en
7 de septiembre de 2026
Número de páginas
7
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$21.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
JOSHCLAY
3.5
(96)
Vendido
457
Seguidores
15
Artículos
21543
Última venta
4 días hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes