I don't know why SyntaxError: can't assign to function call.
When the following code is executed, N_prices (n) = A * n + B * (len (str (n))) occurs.
nums = [int (e) for e in input (). split ()] #A, B, X A, B, X = nums , nums , nums  N_prices (n) = A * n + B * (len (str (n))) if X<= N_prices (0): print ('0') if N_prices (10 ** 9)<= X: print ('109') for i in range (1, 10 ** 9): if X<= N_prices (i) and X<= N_prices (i + 1): print (str (i))
Answer # 1
Self-solved. It was caused by writing like a function definition.
Answer # 2
First, the syntax
N_prices (n) = A * n + B * (len (str (n)))is strange. You cannot assign a value to a function.
Next, I get an error, simply because the function
N_pricesis not defined.
And since the variable
nis not defined, you need to recode it.
As a guess, the questioner seems to have a mathematical syntax when trying to define a function.
In Python, when defining a function ...
def function name (argument): processing return return value
Define it like this.
So in this case ...
def N_prices (n): result = A * n + B * (len (str (n))) return result
The processing part is just a guess, but it looks like this.
- python - when using the cv2adaptivethreshold function in the binarization process of an image, an error occurs in medianblur and
- print function arguments sep, end, etc do not work in python
- i want to do something like a function pointer in a class in python
- python - get right-justified dataframe with split function of pandas dataframe
- python - split function in pandas dataframe
- python - i want to know how this function is recursively defined
- creating a function that gives the standard deviation in python without using numpy
- python - i want to define a function using a csv file
- how to avoid errors in python explode function
- python - in machine learning learning, the accuracy is 100% and the value of the loss function is almost 0 from the beginning an
- i want to create a function to judge python prime numbers and display 15 prime numbers of integer n or more
- python 3x - i want to use python3 tkinter drag and drop function in an exe file
- python - about function calls
- python - i can't double derivative and assign functions in sympy
- can multiple file io by built-in function open using multithreading in python be expected to be faster?
- i want to put the result of a function in a dataframe in python
- unable to use python time function
- python - i want to make a program that retrieves values one by one from a list into a function
- python - recursionerror is thrown when executing a function that reads a flask text file
- python - i don't know how to use requestuser in a django function with a generic view
- python - pandasdataframe i want to match the time columns of two csv and load them
- python - janome analyzer error
- \ r \ n cannot be deleted with python
- python - 'numpyndarray' object has no attribute'append' error
- python - 'numpyndarray' object has no attribute'numpy' error
- an init error that is not used in python and ldl appears
- python - it can be run with jupyter notebook, not vscode
- about auxiliary lines and axis scales of python heatmap
- python scraping jsonloads () jsondecodeerror
- python - about seabornhistplot