Top "Variable-assignment" questions

A process of setting or re-setting the value stored in the storage location(s) denoted by a variable name.

How to make a copy of a 2D array in Python?

X is a 2D array. I want to have a new variable Y that which has the same value as …

python arrays object copy variable-assignment
How do I assign a dictionary value to a variable in Python?

I'm an amateur when it comes to programming, but I'm trying my hand at Python. Basically what I want to …

python variables dictionary variable-assignment key-value
Copy constructor and = operator overload in C++: is a common function possible?

Since a copy constructor MyClass(const MyClass&); and an = operator overload MyClass& operator = (const MyClass&); have pretty …

c++ variable-assignment copy-constructor c++-faq
Correct way to trim a string in Java

In Java, I am doing this to trim a string: String input = " some Thing "; System.out.println("before->>"+…

java string variable-assignment trim
Struct assignment or memcpy?

If I want to replicate a structure in another one (in C), what are the pro&con's of : struct1 = …

c struct variable-assignment memcpy
Set the variable result, from query

When I create the saved procedure, i can create some variable yes? for example: CREATE PROCEDURE `some_proc` () BEGIN DECLARE …

mysql variables stored-procedures variable-assignment multiple-columns
Importing data and variable names from a text file in Python

I have a text file containing simulation data (60 columns, 100k rows): a b c 1 11 111 2 22 222 3 33 333 4 44 444 ... where in the first row are …

python variables dynamic variable-assignment genfromtxt
Assign variable in while loop condition in Python?

I just came across this piece of code while 1: line = data.readline() if not line: break #... and thought, there must …

python while-loop variable-assignment
How can I index a MATLAB array returned by a function without first assigning it to a local variable?

For example, if I want to read the middle value from magic(5), I can do so like this: M = magic(5); …

matlab indexing matrix return-value variable-assignment
Compressing `x if x else y` statement in Python

I'm quite acquainted with Python's ternary operator approach: value = foo if something else bar My question is very simple: without …

python variable-assignment ternary-operator user-friendly