Question: import locale File / Users / daniellewhite / Desktop / Python / locale . py , line 5 , in locale.setlocale ( locale
import locale
File UsersdaniellewhiteDesktopPythonlocalepy line in
locale.setlocalelocaleLCALL, enUSUTF
NameError: name 'locale' is not defined. Did you mean: 'locals'? Or did you forget to import 'locale'?
i keep getting this error no matter what i do here is the code I have
import locale
locale.setlocalelocaleLCALL, enUSUTF
prices
while True:
price floatinputEnter a price:
if price :
printPrice cannot be negative. Please reenter."
continue
prices.appendprice
for p in prices:
printlocalecurrencyp
subtotal sumprices
tax subtotal
total subtotal tax
print
Subtotal:", locale.currencysubtotal
printTax: locale.currencytax
printTotal: locale.currencytotal
choice inputDo you want to enter another price? yesno:
if choice.lower "yes":
break
i have locale as
locale.setlocalelocaleLCALL, enUSUTF
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
