473,468 Members | 4,655 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to make a program to calculate tax

6 New Member
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 14885
bvdet
2,851 Recognized Expert Moderator Specialist
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: 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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.