I am doing Python Hoemwork 2 Store items Why my code shows identation errors? File "", line 7 item1 = input("Enter item 1's name >>") ^ IndentationError: unindent does not match any outer indentation level Here is my current code : # Hard-Coded variable representing the store store = "Welcome to the Store" # print the value of the variable print(store) # two variables which represent the items to be purchased and input from the user item1 = input("Enter item 1's name >>") item2 = input("Enter item 2's name >>") # print the items print("Items are: {orange}, {strawberry}".format(item1, item2)) # two variables for the cost of each item to be purchased cost1 = float(input("Enter cost of item 1: 25")) cost2 = float(input("Enter cost of item 2: 20")) # print the cost with the items print("Item 1 - {} with Cost = {}\nItem 2 - {} with Cost = {}".format(item1, cost1, item2, cost2)) # two variables for computing the subtotal and taxamount for the user # tax amount is 10% of the cost of the items subtotal = cost1 + cost2 taxAmt = subtotal*0.1 # output the subtotal and tax amount print("SubTotal - {}\nTax Amount - {}".format(subtotal, taxAmt))
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
I am doing Python Hoemwork 2 Store items Why my code shows identation errors?
File "<tokenize>", line 7 item1 = input("Enter item 1's name >>") ^ IndentationError: unindent does not match any outer indentation level
Here is my current code :
![# Sophie Sun CRN:CIS101
# Hard-Coded variable representing the store
store = "Welcome to the Store"
wwww
#print the value of the variable
print (store)
# two variables which represent the items to be purchased and input from the user
item1 = input ("Enter item 1's name >>")
item2 = input("Enter item 2's name >>")
# print the items
print("Items are: (orange}, {strawberry}".format(item1, item2))
# two variables for the cost of each item to be purchased
cost1 = float (input("Enter cost of item 1: 25"))
^^^^^^
cost2 = float (input("Enter cost of item 2: 20"))
wwwww
# print the cost with the items
.print("Item 1 {} with Cost = {}\nItem 2- {} with Cost = {}".format(item1, cost1, item2, cost2))
# two variables for computing the subtotal and taxamount for the user
# tax amount is 10% of the cost of the items
cost1 + cost2
subtotal*0.1
subtotal
với điện đến
taxAmt
wwwww
# output the subtotal and tax amount
**********print("SubTotal {}\nTax Amount {}" .format(subtotal, taxAmt))
File "<tokenize>", line 7
item1 = input ("Enter item 1's name >>")
Os
completed at 11:35 AM](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F58e2dfd6-36b3-4ea3-9749-1081be7519f9%2Fdcbba2a2-b5a0-4266-a6e6-e31644295569%2Fbzx0dn3_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)