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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:46:07+00:00 2026-06-08T04:46:07+00:00

I know this is a common question but I could not find the solution

  • 0

I know this is a common question but I could not find the solution for my case. I have gotten a problem while a for-loop in Python. When I run a program with this piece

for j in range(len(line1)- 3):
    print 'j =', j
    spl1 = spline(line1[j], line1[j + 1], line1[j + 2], line1[j + 3], t, Nu)

print 'spl1 ='
matrix.show(spl1)

i get an output:

Traceback (most recent call last):
File "D:\work\curvature\test\twisted\cardinal_spline.py", line 272, in <module> main()
File "D:\work\curvature\test\twisted\cardinal_spline.py", line 111, in main 
matrix.show(spl1)
UnboundLocalError: local variable 'spl1' referenced before assignment

Moreover, it does not print j-variable. I cannot see any mistake there. The “spl1” is assigned in the for-loop but it looks like the interpreter just skips it.

please point on the mistake.

  • 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-08T04:46:09+00:00Added an answer on June 8, 2026 at 4:46 am

    Your for-loop doesn’t get executed at all due to len(line1) <= 3 in some cases, so spl1 isn’t assigned.

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

Sidebar

Related Questions

First, I know this is kind of common question, but I could not find
I know this is a very common question, but I could not find the
I have looked and I could not find this question before, and it surprises
I know this may seem like a common question on SO but I could
Seems like this would be a common question, though I could not find it
I know this is an old question, but I have spend any hours on
I thought this could've been a common question, but it has been very difficult
I know the question sound somewhat stupid, but i have this scenario. Context I
sorry, I know this question might be too common, but I really couldn't figure
I know this is a very common question, but I tried googling and got

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.