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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:14:39+00:00 2026-06-13T09:14:39+00:00

As I know, continue will jump back to the top of the loop. But

  • 0

As I know, “continue” will jump back to the top of the loop. But in my case it’s not jumping back, continue don’t like me 🙁

for cases in files:
  if ('python' in cases.split()):
    execute_python_scripts(cases.split())
    elif run_test_case(cases.split()):
      continue
    else:
      logger("I am here")
      break 

In my case run_test_case() gives 1, 2, 3, 4 etc… But it always performs first(1) and jump to the else part. So I am getting the “I am here” message. It should not work like this. As I am using “continue”, it should jump to the for loop.

Following is the run_test_case():

def run_test_case(job):
  for x in job:
    num_of_cases = num_of_cases - 1
    test_type = x.split('/')
    logger(log_file,"Currently "+ x +"hai!!")
    if test_type[0] == 'volume':
      backdoor = test_type[1].split("_")
      if backdoor[0] == 'backdoor':
        return get_all_nas_logs()
      else:
        if perform_volume_operations(x,num_of_cases) == False:
          return False
        else:
      logger(log_file,"wrong ha!!")

Why is it always going to the else part, without jumping back to the for loop? Thanks in advance.

  • 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-13T09:14:41+00:00Added an answer on June 13, 2026 at 9:14 am

    Here elif run_test_case(cases.split()): you are calling the run_test_case method, that will run your code to evaluate the result for the elif condition.

    It only enters the block delimited by elif (in your case, continue), if the result of that method evaluates to True, otherwise it will jump to the else clause.

    The problem is probably in your run_test_case code, that is never returning True, and so you’ll never get the behavior that you’re expecting.

    It’s hard to say without knowing exactly what you want to accomplish, but I’d say that you’re missing a return True in the end of that code, meaning, if everything executes correctly right until the end, you want it to return True… but I’m only guessing here, you need to think about what that method is supposed to do.

    In python an if or elif clause is evaluated for not only the True and False constants, but more generally for True-like and False-like values. None, for instance, is a false-like value, a non-empty string is a true-like value, etc.

    Check this from the documentation on values that are considered true or false:

    http://docs.python.org/library/stdtypes.html

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

Sidebar

Related Questions

I would like to prototype an object but the problem is, I don't know
Id like to know before I continue if this Book => http://exploring.liftweb.net/ is fit
I know that break , continue , and return functions are built-in. But I
i hat one task, and know i have to continue but have a bad
I know you can not set a key value dynamically, but what about the
I know that Phonegap has an event for back button, but it's only available
Does anyone know if this script will continue to have a future or is
So i've been doing a little searching and I will continue to look, but
Know this might be rather basic, but I been trying to figure out how
I know that this sort of question has been asked here before, but still

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.