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 8340193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:06:47+00:00 2026-06-09T05:06:47+00:00

Is it feasible to utilize %r within raw_input in python? For context, I’m working

  • 0

Is it feasible to utilize %r within raw_input in python?

For context, I’m working on Zed Shaw’s Exercise 12. (Great resource! The lessons are very helpful, and well paced.)

I’m playing around in the extra credit, trying to get raw_input to repeat what I typed in. I know I can accomplish the same thing with a print statement, but am curious if I can accomplish it within raw_input.

The code I’m typing is:

from sys import argv

script, firstname, lastname = argv

age = raw_input("Hello %r, what is your age? ") % firstname

print ("Ahh, Mr. %r, you are %r years old.") % (lastname, age)

The error I get is:

Traceback (most recent call last):
  File "ex13a.py", line 5, in <module>
    age = raw_input("Hello %r, what is your age? ") % firstname
TypeError: not all arguments converted during string formatting

Thanks in advance!

  • 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-09T05:06:48+00:00Added an answer on June 9, 2026 at 5:06 am

    Your line should read

    raw_input("Hello %r, what is your age? " % firstname)
    

    instead of

    raw_input("Hello %r, what is your age? ") % firstname
    

    Otherwise, you would not format your "Hello %r, ..." string, but the resulting string of the call to raw_input.

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

Sidebar

Related Questions

I often write codes in MATLAB/Python to test whether my algorithm is feasible (&
Possible Duplicate: Is it feasible to compile Python to machine code? Is it possible
deprecated : bad example Is it feasible to get execution context (object reference) which
How feasible would it be to compile Python (possibly via an intermediate C representation)
Is it feasible in Java using the SAX api to parse a list of
Is it feasible (financially) to host centralised mercurial repositories on Amazon S3. As far
Short version: Is it easy/feasible/possible to program modal window in Flash (AS3)? Is there
Does anyone know if it is feasible to write a Generic JMS client -
Maybe this isn't really feasible. But basically, I've been developing a snippet-sharing website and
Setting up the sandboxes for all these option is not feasible right now. So

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.