100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Python_Programming_FinalExam

Rating
-
Sold
-
Pages
4
Grade
A+
Uploaded on
22-07-2023
Written in
2022/2023

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:

Show more Read less
Institution
Python Programming
Course
Python Programming








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Python Programming
Course
Python Programming

Document information

Uploaded on
July 22, 2023
Number of pages
4
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
datascience24 Self
View profile
Follow You need to be logged in order to follow users or courses
Sold
84
Member since
3 year
Number of followers
16
Documents
159
Last sold
1 month ago

Please message me using Send Message option for new assignment requests.

4.5

12 reviews

5
10
4
0
3
1
2
0
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions