Answered step by step
Verified Expert Solution
Question
1 Approved Answer
My paths and information are correct. Im trying to just get a series of stars ( * * * * * ) to appear infront
My paths and information are correct. Im trying to just get a series of stars to appear infront of the digits of the social. It should look like
But when I try my code breaks saying
Traceback most recent call last:
File C:PythonPythontestpy line in
ShowData # Display employee information
File C:PythonPythontestpy line in ShowData
obj.getLname obj.getsocial: obj.gethrsworked obj.getrate obj.getgross
TypeError: bad operand type for unary : str
As far as I can tell this should work its worked through the rest of my code but doesnt here. Here is the section it came from. Note: The blank space in the between the first set of plus signs has to be there to match the code format of what this is supposed to be It does not throw an error. I only got an error after adding in the series of stars but I also need those to match the format but they are whats breaking the code. Why would it take one over the other and how would I alleviate this?
def ShowData:
#displays information
try:
with openC:employeedat", rb as file:
print: : : : : formatEmployee Name", ID "Hours Worked", "Pay Rate", "Gross Pay"
print
while True:
try:
obj pickle.loadfile
print: : : : : formatobjgetFname
obj.getLname
obj.getsocial: obj.gethrsworked obj.getrate obj.getgross
except EOFError:
break
except FileNotFoundError:
printThe file could not be found."
if namemain:
# runs the following functions
EmployeeInfo # Input employee information
ShowData # Display employee information
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started