I want to calculate indefinite integration in Python...So how can i get a variable without assigning value to it...
Asked
Active
Viewed 7,802 times
-1
-
#Check-out the question in the [link](https://stackoverflow.com/q/47865586/9112578) – MSD Jun 23 '18 at 10:01
-
@MSD I used Sympy library and also posted that as an answer but someone downvoted my answer. – Siladittya Jun 24 '18 at 14:31
-
@MSD Thanks btw – Siladittya Jun 24 '18 at 14:31
4 Answers
3
You could use value = None. More information can be found in this related SO post.
It would helpful if we could see an example of exactly what you are trying to do so we could help your problem specifically.
Community
- 1
- 1
Toby Hughes
- 84
- 5
-
I know you can't add comments yet but why post this answer when it has already been provided as a **comment** by Peter? – Dimitris Fasarakis Hilliard Sep 16 '15 at 07:52
-
I hadn't seen the comment in the time that I posted this. I came to the post before his comment and posted after his comment. I mean, I could delete it if its really that important, but I feel that the related link is helpful in this case. – Toby Hughes Sep 16 '15 at 07:58
-
3@DimitrisJim Comments are usually used for clarification and discussion that is not directly answering the question. A question on SO is considered answered only when an answer has been provided and accepted. That is a signal to people that THIS is the answer and the solution WORKS. – nestedloop Sep 16 '15 at 07:58
1
Because python is not like C or java or so, when you declare a new variable you don't have to indicate the type explicitly. Thus you can't leave a blank after the variable name to make it valueless.
For python a wise way to do so is to actually assign a 'noun' value to it.
variable_name = None
Derrick.D
- 19
- 2
0
You can set up a variable without assigning value to it like this:
variable = []
LuukS
- 171
- 2
- 12
-
but can it be raised to **power** ???....like x=[] and can i do x**2 or x**3 with it?? .....actually i want to do **integration** .... – Siladittya Sep 18 '15 at 05:14
-