I have an assignment for creating cost for a sign. I have done everything for the assignment, and the code even runs perfectly the way it wants it. however, it keeps giving me the error “Reason: Unable to determine color type. Type mismatch: Cannot replace Call with str” which is slicing my grade by 50%, really annoying
this is my code. To reiterate, it works fine. For example, it wants the price of a gold text sign, with 8 letters and pine to be 62$ which is what the price ends up being by the end of the program
`# HouseSign.py - This program calculates prices for custom house signs.
# Initialize variables here.
charge = 0
num_chars = 8
color = "gold"
wood_type = "oak"
minChars = 5
costChars = 4
# Charge for this sign.
# Number of characters.
print("The first five letters are included in the minimum charge, but each individual character afterwards is an additional 4$")
num_chars = int(input("Enter how many characters you will have on the sign: "))
if num_chars > minChars:
charge = (num_chars - minChars) * costChars
# Color of characters.
color = input("Do you wan to pay 15$ additional for gold lettering or black and white: ")
if color == "gold":
charge = charge + 15
elif color == "black and white":
charge
# Type of wood.
wood_type = input("Do you wan to pay 20$ additional oak or pine: ")
if wood_type == "oak":
charge = charge + 20
elif wood_type == "pine":
charge
# Write assignment and if statements here as appropriate.
# Output Charge for this sign.
charge = charge + 35
print(f"The charge for this sign is ${charge:.2f}")`
liam ruddy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.