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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:30:04+00:00 2026-06-05T14:30:04+00:00

Why does the following code make my machine do a beep-tone? print ‘\78’ I

  • 0

Why does the following code make my machine do a beep-tone?

print '\78'

I have tested it in the interactive interpreter and running a script in the command-line. I have also tested it in an embedded environment and it does not invoke a beep there.

  • 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-05T14:30:05+00:00Added an answer on June 5, 2026 at 2:30 pm

    It interprets \7 as the octal escape, so it’s BEL with ASCII code 7. This is a character that, when printed on a terminal, rings a bell. Yes, a literal bell in ancient times with teletypes (and even some terminals). Since we pride ourselves in not letting 1960s technology go to waste every terminal emulator has the same capability of making a sound at the sight of a character. Why it doesn’t work in the embedded environment: Well, it’s probably no terminal emulator you’re having there.

    The documentation says that “As in Standard C, up to three octal digits are accepted.” Since 8 is no valid octal digit it stops with \7.

    If you want the literal string \78, prefix an r:

    print r'\78'
    

    If you want the character 0x78 (x), then add an x:

    print '\x78'
    

    If you ask me, though, any octal niceties should be banned from programming languages unless when inventing new escape codes for them, e.g. \o123 for strings or 0o153 for literals. The two conventions carried over from C here into countless programming languages just because it takes no effort to do so is in my humble opinion misguided and stupid.

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

Sidebar

Related Questions

I have the following code; I want to make sure that submit does not
Why does the following code always print out 127 (The specified procedure could not
I have the following code that does a circular shift of the bits in
I have the following setup: Code on my local machine (OS X) shared as
Does the following code run on the main thread? Does main queue refer to
Does the following code will increase the allocated memory continuously as it is called
What does the following code do? Can the LinkedHashSet be replaced with a HashSet
Why does the following code result in a java.lang.ArrayIndexOutOfBoundsException: 0 >= 0 ? JTable
How does the following code compile correctly, #include <stdio.h> #define stringer( x ) printf_s(
Why does the following code return with a segmentation fault? When I comment out

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.