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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:44:00+00:00 2026-06-18T14:44:00+00:00

I have a small bit of code that seems to be acting improperly; I’m

  • 0

I have a small bit of code that seems to be acting improperly; I’m new to Python, and imagine I’m overlooking something. The code is:

bs = ("\b", "\b", "\b", "\b", "\b", "\b", "\b", "\b", "\b");
print "b%ra%rc%rk%rs%rl%ra%rs%rh%r" % bs;
print "b%sa%sc%sk%ss%sl%sa%ss%sh%s" % bs;

When I run this in Powershell the output is:

b\x08a\x08c\x08k\x08s\x08l\x08a\x08s\x08h\x08
h

Why does the last h\b evaluate to h when using string (%s) output, when it seems like it should be deleted from the raw (%r) output?

  • 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-18T14:44:01+00:00Added an answer on June 18, 2026 at 2:44 pm

    You are not erasing the character with a \b; you are only backing up one position.

    So the characters are overwritten by the next printed character instead. Add a space and it works:

    >>> print "b%sa%sc%sk%ss%sl%sa%ss%sh%s " % bs
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have this small bit of code that generates rows and columns of
Python 2.6 on Redhat 6.3 I have a device that saves 32 bit floating
I have a small python VTK function that calculates the volume and surface area
I have this small snippet to change a bit of html when a user
I have small test app: Socket socket = new Socket(jeck.ru, 80); PrintWriter pw =
I have small web app that generate PDF files as a report. I'm trying
I have a small front end to a webshop. All customers that go through
Strange Question i guess but i have this bit of code in my page...
Here's the page in question: http://bit.ly/m5cyjx There's hardly any code or styling. It seems
I have this small exercise that I am trying to finish, but I get

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.