python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Appending to a class instance attribute in python
I have a list of class instances, and I want to append separate items to an attribute for each. However, I ended up appending each item to the attribute on every instance in the list. Example code bel...
name
Votes: 0
Answers: 1
Add list within list while creating a new 'label'
I have 2 lists; or at least, I believe they are lists:
one = [{'sex': 'M', 'age': 22},
{'sex': 'M', 'age': 76},
{'sex': 'F', 'age': 37},
{'sex': 'F', 'age': 45}]
two = [0, 1, 0, 0]
...
johnjohn
Votes: 0
Answers: 3
Python - append zeros to beginning of numbers depending on the string length
i have python script that results in numbers, for example
1001
10001
100001
i need to append zeroes at the beginning that the length is always equal to 10
0000001001
0000010001
0000100001
i need to kn...
DRShams
Votes: 0
Answers: 2
bash how to append to an array inside a IFS while loop
I have the following script:
#!/bin/bash
pstdout="PASS"
fstdout="FAIL"
error_string_check="ERROR"
stdout_result(){
result="$1"
shift
des="$1&...
Dave
Votes: 0
Answers: 1