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

  • Home
  • SEARCH
  • 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 8787953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:01:19+00:00 2026-06-13T22:01:19+00:00

I have a indentation error in Python and i dont know why and how

  • 0

I have a indentation error in Python and i dont know why and how to resolve it.

I looked for special characters that i might have missed, but none found;

Why do i get this error ?

user = {'_id':username}

users.find_one(user)

enter image description here

IN CONCLUSSION : NEVER MIX TABS WITH SPACES!

  • 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-13T22:01:20+00:00Added an answer on June 13, 2026 at 10:01 pm

    The most common reason for this type of error is mixing tabs and spaces.

    To fix it try converting all tabs to spaces in your file.

    From PEP 8 — Style Guide for Python Code:

    Tabs or Spaces?

    Never mix tabs and spaces.

    The most popular way of indenting Python is with spaces only. The second-most popular way is with tabs only. Code indented with a mixture of tabs and spaces should be converted to using spaces exclusively. When invoking the Python command line interpreter with the -t option, it issues warnings about code that illegally mixes tabs and spaces. When using -tt these warnings become errors. These options are highly recommended!

    For new projects, spaces-only are strongly recommended over tabs. Most editors have features that make this easy to do.

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

Sidebar

Related Questions

I have lot of issues with Python indentation with the Notepad++. Inorder to resolve,
I am a newbie to python and I have an indentation error message when
I am getting a strange incorrect indentation error that I cannot track down. As
I have some python code that fails: import sys print (MathCheats Times-Ed by jtl999)
This is my code that I have looked through for a couple of hours.
I have never done Python programming before but I have done a lot of
I am getting an indentation error, but my code is indented properly. If I
when I open Python files my indentation changes. I have the following vimrc settings:
I'm just starting to learn python and keep getting an error that I just
Is it possible to have individual indentation of items in a QTreeWidget? In specific,

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.