Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8839217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:11:25+00:00 2026-06-14T10:11:25+00:00

Right now, I’m making a program to find how many reams of paper you’d

  • 0

Right now, I’m making a program to find how many reams of paper you’d have to buy if you’re making a presentation to a group of people and you have to print copies of your presentation. When I go to run the program, it comes up with:

Traceback (most recent call last):
File "C:/Users/Shepard/Desktop/Assignment 5.py", line 11, in <module>
print ("Total Sheets: " & total_Sheets & " sheets")
TypeError: unsupported operand type(s) for &: 'str' and 'int'
>>> 

What I’m trying to do is:

print ("Total Sheets: " & total_Sheets & " sheets")
print ("Total Reams: " & total_Reams & " reams")

Should I not be using the & operator to combine the string and integer types with print? If not, what am I doing wrong?

Here’s my whole program.

ream = 500
report_Input = int (input ("How many pages long is the report?"))
people_Input = int (input ("How many people do you need to print for? -Automatically prints five extras-"))


people = people_Input + 5

total_Sheets = report_Input * people
total_Reams =((total_Sheets % 500) - total_Sheets) / people

print ("Total Sheets: " & total_Sheets & " sheets")
print ("Total Reams: " & total_Reams & " reams")

EDIT: After I posted this I found that Jon Clements answer was the best answer, and I also found that I needed to put in an if statement to make it work. Here’s my finished code, thanks to all that helped.

ream = 500
report_Input = int (input ("How many pages long is the report?"))
people_Input = int (input ("How many people do you need to print for? -Automatically prints five extras-"))


people = people_Input + 5

total_Sheets = report_Input * people
if total_Sheets % 500 > 0:
    total_Reams =(((total_Sheets - abs(total_Sheets % 500))) / ream)+1
else:
    total_reams = total_Sheets / ream


print ("Total Sheets:", total_Sheets, "sheets")
print ("Total Reams:", total_Reams, "reams")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:11:27+00:00Added an answer on June 14, 2026 at 10:11 am

    Firstly & isn’t the concatanation operator (it’s the bitwise and operator) – that’s +, but even that doesn’t work between a str and an int…, you can use

    Python2.x

    print 'Total Sheets:', total_Sheets, 'sheets'
    

    Python 3.x

    print ('Total Sheets:', total_Sheets, 'sheets')
    

    Alternatively, you can use string formatting:

    print 'Total Sheets: {0} sheets'.format(total_Sheets)
    

    (NB: From 2.7+ you can omit the positional parameter, and just use {} if you wanted)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have 3 tables: User, Roles, and User_Roles for the many-to-many association.
Right now, I have elements with different z-index , and I want to group
right now I have a group of svg elements (circle, rect, path, etc.).The actual
Right now I have an upload field while uploads files to the server. The
Right now, I have: RewriteRule ^([^/\.]+)?$ index.php?id=$1 [L] to match any username at the
Right now I have a script that will get the last five files in
Right now I have a function, in a class that is used to listen
Right now I came across the Observer/Observable pattern where I have my Observable notify
Right now I have formatted my cell with: h hours m minutes So if
right now i have a wrapper written in c++/cli, which is used in c#(WPF).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.