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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:24:55+00:00 2026-06-10T21:24:55+00:00

I know this is going to sound silly but I cannot for the life

  • 0

I know this is going to sound silly but I cannot for the life of me figure out the logic behind how this for loop returns 13,11,9,7.

    for i in range(13,5,-1):
        if i % 2 != 0:
            print i

I know the first value is the number it starts with, the second is where it stops, and the third being the steps it takes. The “if i % 2 !=0:” is what is throwing me off. Can anybody explain what is happening for me?

  • 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-10T21:24:57+00:00Added an answer on June 10, 2026 at 9:24 pm

    the first bit is the range(13,5,-1) which just counts backwards from 13 to 6. The next bit is i%2 != 0. i%2 == 0 is equivalent to saying if even, or “if this number can be divided by 2 with no remainder”, so your statment is saying “if odd” (which is obviously the same as “if not even“).

    Basically, the loop is printing odd numbers starting at 13 and decreasing down to 6 (but 6 is even, so it doesn’t get printed)

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

Sidebar

Related Questions

I know this is going to sound silly but I can't find what's wrong.
Ok I know this is going to sound weird but it is what the
Know this might be rather basic, but I been trying to figure out how
I know this question is going to sound very stupid but here goes nonetheless.
I know I am going to sound very noobish for asking this question BUT
This is going to sound super hackish but does anyone know of a way
I know this is going to sound like a dumb question, but as I'm
I know this may sound silly, but I'd like to put a version in
Okay, I know this is going to sound like homework; but here goes any
All right, this one is going to sound very weird and I don't know

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.