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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:05:18+00:00 2026-05-13T23:05:18+00:00

Using the code print(‘{0} is not’.format(‘That that is not’)) in Python 3.1.1, I get

  • 0

Using the code print('{0} is not'.format('That that is not')) in Python 3.1.1, I get the following error:

AttributeError: 'str' object has no attribute 'format'

when I delete the line Netbeans automatically inserted at the beginning:

from distutils.command.bdist_dumb import format

which itself causes an error of

ImportError: cannot import name format

What am I doing wrong here?

  • 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-05-13T23:05:18+00:00Added an answer on May 13, 2026 at 11:05 pm

    You must be running an older version of Python. This does work in Python 3.1.1+:

    $ python3
    Python 3.1.1+ (r311:74480, Nov  2 2009, 14:49:22) 
    [GCC 4.4.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> '{0} is not'.format('That that is not')
    'That that is not is not'
    

    You will, however, get this error in Python 2.5.4:

    $ python2.5
    Python 2.5.4 (r254:67916, Jan 20 2010, 21:44:03) 
    [GCC 4.4.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> '{0} is not'.format('That that is not')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'str' object has no attribute 'format'
    

    This feature seems to have been backported to Python 2.6, so you won’t get this error there. You must be running Python < 2.6.

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

Sidebar

Related Questions

Using Python v2, I have the following code: print (Total of the sale is:
I'm using following code to print HTML content containing text and images. if (![UIPrintInteractionController
I'm using the following code and I can't figure out why it's not raising
I'm currently using the following code to print the elapsed time (in seconds) on
I am using the following code to print a word document from a C#
I'm using the following code to print the current time. use Getopt::Long; use Time::Local;
I'm reading XML file using Etree module. Im using following code to print the
I am using the following code to print a page within my application... <html><body
In my app I am displaying Print option from UIButton using following code. UIPrintInfo*
I'm using the following code to print an image from a PictureBox. All works

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.