473,386 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to make a program to calculate tax

I'm trying to make a python program that

1) prompts the user to enter the value of the sale with the following statement:
“Enter the value of the company’s sales in dollars in August 2013:”

2)The sale value should be stored in a variable of type float

3)Compute the sales tax based on 6% of the sale

4) Print the resulting sales tax in the following format:
“The sales tax is $ for August 2013 ”

This is the code I currently have
Expand|Select|Wrap|Line Numbers
  1. salevalue = int(input("Enter the value of the company's sales in dollars in August 2013"))
  2.  
  3. saletax = float(salevalue*0.06)
  4.  
  5. print("The sales tax is" + saletax + "for August 2013")
I am very new to programming in python so I really have no idea where to go from here. Thanks for reading :)
Jan 26 '15 #1

✓ answered by bvdet

To print the result, you can use the format method.
Expand|Select|Wrap|Line Numbers
  1. >>> saletax = float(256753*0.06)
  2. >>> print("The sales tax is ${s:.2f} for August 2013".format(s=saletax))
  3. The sales tax is $15405.18 for August 2013
  4. >>> 

1 14856
bvdet
2,851 Expert Mod 2GB
To print the result, you can use the format method.
Expand|Select|Wrap|Line Numbers
  1. >>> saletax = float(256753*0.06)
  2. >>> print("The sales tax is ${s:.2f} for August 2013".format(s=saletax))
  3. The sales tax is $15405.18 for August 2013
  4. >>> 
Jan 26 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Nicky | last post by:
hi,all We are going to develop a program and when it is running, we need it full screen and also, user can not switch to other place before exit our program. I am thinking, we can make a window...
0
by: Nicky | last post by:
hi,all We are going to develop a program and when it is running, we need it full screen and also, user can not switch to other place before exit our program. I am thinking, we can make a window...
5
by: scorpion53061 | last post by:
Is there a way that anyone knows to force a vb.net program to shut down and then restart itself?
1
by: Anh Khuong | last post by:
Hi all, In some cases I click button to open dialog using ShowDialog(this) method, it make program freeze. Can you show me which cases this method cause problem above? Here are stack dump...
7
by: imhiya | last post by:
Heres what ive got so far 0.o im more of a beginner Though =[ Dim Tim As Integer Dim Often As Integer Dim EndT As Integer Private Sub cmdStart_Click() Do 'Loop If Tim = Often Then ...
3
by: wuzertheloser | last post by:
The correct program should look like this: Total number of voting cards: 55 Votes for candidate 1: 1 Votes for candidate 2: 10 Votes for candidate 3: 8 Votes for candidate 4: 13 Votes...
2
by: Bisyar khub | last post by:
hello,...i want to make program to square the numbers from 1 to 20. i have written this program, it's running but not giving the required answer.i think it is giving a garbage value...please tell me...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.