Python is coming up with this error for my code and don't understand why. Any help would be great. [on hold] The Next CEO of Stack OverflowPython function error problemEstimating a derivative of a linear data series using a parabolic fitDFT Shift theoremComputing coordinates of vertices in a SSS triangleVerify the Riemann Hypothesis for first 1000 zeros.Why Sampling distribution not skewed when np < 10 and nq < 10?Gauss-Seidel Method, differences from key in PythonCutting 3D Point cloud and interpolate between pointsPlease help with context on this math equation for a Python applicationquadratic bezier to parabola matrix equation
is it ok to reduce charging current for li ion 18650 battery?
Some questions about different axiomatic systems for neighbourhoods
What is the value of α and β in a triangle?
Is there a way to save my career from absolute disaster?
Bartok - Syncopation (1): Meaning of notes in between Grand Staff
Is there a difference between "Fahrstuhl" and "Aufzug"
Why doesn't UK go for the same deal Japan has with EU to resolve Brexit?
Chain wire methods together in Lightning Web Components
Easy to read palindrome checker
How do I align (1) and (2)?
Method for adding error messages to a dictionary given a key
Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?
Should I tutor a student who I know has cheated on their homework?
Prepend last line of stdin to entire stdin
INSERT to a table from a database to other (same SQL Server) using Dynamic SQL
Why did CATV standarize in 75 ohms and everyone else in 50?
Does soap repel water?
Why don't programming languages automatically manage the synchronous/asynchronous problem?
Running a General Election and the European Elections together
How to invert MapIndexed on a ragged structure? How to construct a tree from rules?
Powershell. How to parse gci Name?
Need help understanding a power circuit (caps and diodes)
Can MTA send mail via a relay without being told so?
Is it my responsibility to learn a new technology in my own time my employer wants to implement?
Python is coming up with this error for my code and don't understand why. Any help would be great. [on hold]
The Next CEO of Stack OverflowPython function error problemEstimating a derivative of a linear data series using a parabolic fitDFT Shift theoremComputing coordinates of vertices in a SSS triangleVerify the Riemann Hypothesis for first 1000 zeros.Why Sampling distribution not skewed when np < 10 and nq < 10?Gauss-Seidel Method, differences from key in PythonCutting 3D Point cloud and interpolate between pointsPlease help with context on this math equation for a Python applicationquadratic bezier to parabola matrix equation
$begingroup$
import math
import numpy as np
import matplotlib.pyplot as plt
def f(theta):
l1=3
l2=*math.sprt(2)
l3=3
p1=5
p2=5
p3=3
gamma=(math.pi)/4
x1=5
x2=0
y2=6
a2 =(13*(math.cos(theta)))-x1
b2=12*(math.sin(theta))
a3=(13*(math.cos(theta+gamma)))-x2
b3=12*(math.sin(theta+gamma))-y2
n1=b3*((np.square(p2))-np.square(p1)-np.square(a2)-np.square(b2))-(b2*(np.square(p3)-np.square(p1)-np.square(a2)-np.square(b3)))
n2=-a3*((np.square(p2))-np.square(p1)-np.square(a2)-np.square(b2))+(a2*(np.square(p3)-np.square(p1)-np.square(a3)-np.square(b3)))
d=2*((a2*b3)-(b2*a3))
out=np.square(n1)+np.square(n2)-np.square(p1)*np.square(d)
return out
plt.plot(f(2),f(3))
The error is
File "", line 9
p2=5
^
SyntaxError: can't use starred expression here
python
$endgroup$
put on hold as off-topic by Javi, YiFan, Cesareo, Eevee Trainer, Parcly Taxel 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question is not about mathematics, within the scope defined in the help center." – YiFan, Cesareo, Eevee Trainer, Parcly Taxel
add a comment |
$begingroup$
import math
import numpy as np
import matplotlib.pyplot as plt
def f(theta):
l1=3
l2=*math.sprt(2)
l3=3
p1=5
p2=5
p3=3
gamma=(math.pi)/4
x1=5
x2=0
y2=6
a2 =(13*(math.cos(theta)))-x1
b2=12*(math.sin(theta))
a3=(13*(math.cos(theta+gamma)))-x2
b3=12*(math.sin(theta+gamma))-y2
n1=b3*((np.square(p2))-np.square(p1)-np.square(a2)-np.square(b2))-(b2*(np.square(p3)-np.square(p1)-np.square(a2)-np.square(b3)))
n2=-a3*((np.square(p2))-np.square(p1)-np.square(a2)-np.square(b2))+(a2*(np.square(p3)-np.square(p1)-np.square(a3)-np.square(b3)))
d=2*((a2*b3)-(b2*a3))
out=np.square(n1)+np.square(n2)-np.square(p1)*np.square(d)
return out
plt.plot(f(2),f(3))
The error is
File "", line 9
p2=5
^
SyntaxError: can't use starred expression here
python
$endgroup$
put on hold as off-topic by Javi, YiFan, Cesareo, Eevee Trainer, Parcly Taxel 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question is not about mathematics, within the scope defined in the help center." – YiFan, Cesareo, Eevee Trainer, Parcly Taxel
add a comment |
$begingroup$
import math
import numpy as np
import matplotlib.pyplot as plt
def f(theta):
l1=3
l2=*math.sprt(2)
l3=3
p1=5
p2=5
p3=3
gamma=(math.pi)/4
x1=5
x2=0
y2=6
a2 =(13*(math.cos(theta)))-x1
b2=12*(math.sin(theta))
a3=(13*(math.cos(theta+gamma)))-x2
b3=12*(math.sin(theta+gamma))-y2
n1=b3*((np.square(p2))-np.square(p1)-np.square(a2)-np.square(b2))-(b2*(np.square(p3)-np.square(p1)-np.square(a2)-np.square(b3)))
n2=-a3*((np.square(p2))-np.square(p1)-np.square(a2)-np.square(b2))+(a2*(np.square(p3)-np.square(p1)-np.square(a3)-np.square(b3)))
d=2*((a2*b3)-(b2*a3))
out=np.square(n1)+np.square(n2)-np.square(p1)*np.square(d)
return out
plt.plot(f(2),f(3))
The error is
File "", line 9
p2=5
^
SyntaxError: can't use starred expression here
python
$endgroup$
import math
import numpy as np
import matplotlib.pyplot as plt
def f(theta):
l1=3
l2=*math.sprt(2)
l3=3
p1=5
p2=5
p3=3
gamma=(math.pi)/4
x1=5
x2=0
y2=6
a2 =(13*(math.cos(theta)))-x1
b2=12*(math.sin(theta))
a3=(13*(math.cos(theta+gamma)))-x2
b3=12*(math.sin(theta+gamma))-y2
n1=b3*((np.square(p2))-np.square(p1)-np.square(a2)-np.square(b2))-(b2*(np.square(p3)-np.square(p1)-np.square(a2)-np.square(b3)))
n2=-a3*((np.square(p2))-np.square(p1)-np.square(a2)-np.square(b2))+(a2*(np.square(p3)-np.square(p1)-np.square(a3)-np.square(b3)))
d=2*((a2*b3)-(b2*a3))
out=np.square(n1)+np.square(n2)-np.square(p1)*np.square(d)
return out
plt.plot(f(2),f(3))
The error is
File "", line 9
p2=5
^
SyntaxError: can't use starred expression here
python
python
asked Mar 27 at 19:01
Kris LetangKris Letang
1
1
put on hold as off-topic by Javi, YiFan, Cesareo, Eevee Trainer, Parcly Taxel 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question is not about mathematics, within the scope defined in the help center." – YiFan, Cesareo, Eevee Trainer, Parcly Taxel
put on hold as off-topic by Javi, YiFan, Cesareo, Eevee Trainer, Parcly Taxel 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question is not about mathematics, within the scope defined in the help center." – YiFan, Cesareo, Eevee Trainer, Parcly Taxel
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
I guess you could change l2 =*math.sprt(2)
to l2 *= math.sqrt(2)
and see what happens.
$endgroup$
$begingroup$
And presumablysprt
should besqrt
.
$endgroup$
– Théophile
Mar 27 at 19:10
$begingroup$
Yeah of course.
$endgroup$
– model_checker
Mar 27 at 19:11
add a comment |
$begingroup$
The error clearly isn't happening where it claimed - so we look earlier. That line
l2=*math.sprt(2)
is the post obvious source of trouble. For one thing, it's a typo; "sprt" is not a function in the "math" library.
For another, " =* " is not something the grammar recognizes. " *= " would make sense multiplying a preexisting value by whatever comes after the symbol, but you haven't defined l2 yet, so more likely that's just supposed to be
l2 = math.sqrt(2)
$endgroup$
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
I guess you could change l2 =*math.sprt(2)
to l2 *= math.sqrt(2)
and see what happens.
$endgroup$
$begingroup$
And presumablysprt
should besqrt
.
$endgroup$
– Théophile
Mar 27 at 19:10
$begingroup$
Yeah of course.
$endgroup$
– model_checker
Mar 27 at 19:11
add a comment |
$begingroup$
I guess you could change l2 =*math.sprt(2)
to l2 *= math.sqrt(2)
and see what happens.
$endgroup$
$begingroup$
And presumablysprt
should besqrt
.
$endgroup$
– Théophile
Mar 27 at 19:10
$begingroup$
Yeah of course.
$endgroup$
– model_checker
Mar 27 at 19:11
add a comment |
$begingroup$
I guess you could change l2 =*math.sprt(2)
to l2 *= math.sqrt(2)
and see what happens.
$endgroup$
I guess you could change l2 =*math.sprt(2)
to l2 *= math.sqrt(2)
and see what happens.
edited Mar 27 at 19:11
answered Mar 27 at 19:09
model_checkermodel_checker
4,41621931
4,41621931
$begingroup$
And presumablysprt
should besqrt
.
$endgroup$
– Théophile
Mar 27 at 19:10
$begingroup$
Yeah of course.
$endgroup$
– model_checker
Mar 27 at 19:11
add a comment |
$begingroup$
And presumablysprt
should besqrt
.
$endgroup$
– Théophile
Mar 27 at 19:10
$begingroup$
Yeah of course.
$endgroup$
– model_checker
Mar 27 at 19:11
$begingroup$
And presumably
sprt
should be sqrt
.$endgroup$
– Théophile
Mar 27 at 19:10
$begingroup$
And presumably
sprt
should be sqrt
.$endgroup$
– Théophile
Mar 27 at 19:10
$begingroup$
Yeah of course.
$endgroup$
– model_checker
Mar 27 at 19:11
$begingroup$
Yeah of course.
$endgroup$
– model_checker
Mar 27 at 19:11
add a comment |
$begingroup$
The error clearly isn't happening where it claimed - so we look earlier. That line
l2=*math.sprt(2)
is the post obvious source of trouble. For one thing, it's a typo; "sprt" is not a function in the "math" library.
For another, " =* " is not something the grammar recognizes. " *= " would make sense multiplying a preexisting value by whatever comes after the symbol, but you haven't defined l2 yet, so more likely that's just supposed to be
l2 = math.sqrt(2)
$endgroup$
add a comment |
$begingroup$
The error clearly isn't happening where it claimed - so we look earlier. That line
l2=*math.sprt(2)
is the post obvious source of trouble. For one thing, it's a typo; "sprt" is not a function in the "math" library.
For another, " =* " is not something the grammar recognizes. " *= " would make sense multiplying a preexisting value by whatever comes after the symbol, but you haven't defined l2 yet, so more likely that's just supposed to be
l2 = math.sqrt(2)
$endgroup$
add a comment |
$begingroup$
The error clearly isn't happening where it claimed - so we look earlier. That line
l2=*math.sprt(2)
is the post obvious source of trouble. For one thing, it's a typo; "sprt" is not a function in the "math" library.
For another, " =* " is not something the grammar recognizes. " *= " would make sense multiplying a preexisting value by whatever comes after the symbol, but you haven't defined l2 yet, so more likely that's just supposed to be
l2 = math.sqrt(2)
$endgroup$
The error clearly isn't happening where it claimed - so we look earlier. That line
l2=*math.sprt(2)
is the post obvious source of trouble. For one thing, it's a typo; "sprt" is not a function in the "math" library.
For another, " =* " is not something the grammar recognizes. " *= " would make sense multiplying a preexisting value by whatever comes after the symbol, but you haven't defined l2 yet, so more likely that's just supposed to be
l2 = math.sqrt(2)
answered Mar 27 at 19:16
jmerryjmerry
16.9k11633
16.9k11633
add a comment |
add a comment |