• ¿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 1 fuera de 4 páginas
Examen

Python_Programming_FinalExam

Document preview thumbnail
Vista previa 1 fuera de 4 páginas

1. 1. Write a Python program “FinalE” to complete the following: • Define a class Shape (to be used as a super class) with data attributes color, filled (you may define “filled” in whatever you prefer, such as 1—filled, 0—not filled; yes—filled, no—not filled, or using True/False, …). • Define a subclass, Triangle, that extends class Shape, with 3 data attributes: side1, sisde2, side3 (for the 3 sides). • Implement methods __init__ and __str__ in both of the classes • Implement methods, area() and perimeter() for class Triangle. • Implement regular set/get methods for the data attributes. • Define regular main() function in which proper inputs should be read from keyboard (you need to use try-except for validation of the inputs—see the following sample testing) for the creation of Triangle object and display the object properties, such as the color, whether filled or not, area, perimeter. o Need to check whether the input can form a triangle (if the sum of any two sides is less than the third side, all these 3 inputs for the sides cannot form a triangle.) • Test your program and take screenshots of running your program. 2. 2. Write a Python program (its name must be “FinalE”) that reads a string and check the string to see whether it is a valid “secure code” according to the following rules: • At least two uppercase letters. • At least one lowercase letter. • It includes at least two digits, and the sum of the digits must be an odd number. • It includes at least one vowel (Vowels are the letters a, e, i, o, u and their uppercase cousins). • It includes at least one special character (i.e., @, #, $, %, &). Have your code well designed and organized: in addition to defining a main function, you would need to define at least two other functions to be called in the main function. Hints: Python string has defined many functions/methods for you to use in this project; also you may find the following function, if called, will return a list of Characters (or single-letter-strings), for example, [“h”, “e”, “l”, “l”, “o”] for “hello” useful for this project:


Información del documento

Subido en
22 de julio de 2023
Número de páginas
4
Escrito en
2022/2023
Tipo
Examen
Contiene
Preguntas y respuestas
$15.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.
datascience24
4.5
(12)
Vendido
87
Seguidores
16
Artículos
159
Última venta
6 meses 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

Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.