+ 2
Help đ€·đœââïžI donât know whats wrong with this code
>>>> Def f(x): return (2*x)**2+(2*x)+3 >>>> num =[f(2)] if 1 ==1 print(â f(x)=(2*x)**2+(2*x)+3\n = â) Num[0]
6 Réponses
+ 3
This works (missing : on if, uppercase, and num wasn't in print.):
def f(x):
return (2*x)**2+(2*x)+3
num =[f(2)]
if 1 ==1:
print(" f(x)=(2*x)**2+(2*x)+3\n = "+str(num[0]))
+ 3
You're using Python shell?
+ 2
Yea Iâm using python shell
+ 2
it converts the number into a string so it can be concatenated together with your equation string.
+ 1
If itâs python, I know for a fact def should not be capitalized but that might just be a typo here. đ€
+ 1
What does +str mean?