Tag: na

59 votes
23 answers
3.1K views
What does an exclamation mark mean in the Swift language?

The Swift Programming Language guide has the following example: class Person { let name: String init

avatar
Keila
0 1 0 9
asked 07 September, 2021
61 votes
17 answers
438 views
How do I see which version of Swift I'm using?

I just created a new Swift project within Xcode. I am wondering which version of Swift it's using. How

avatar
Margo
0 1 0 9
asked 07 September, 2021
65 votes
15 answers
1.3K views
How to list npm user-installed packages?

How do I list the user-installed package ONLY in npm? When I do npm -g list it outputs every package and their

avatar
Dario
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
2.1K views
map function for objects (instead of arrays)

I have an object: myObject = { 'a': 1, 'b': 2, 'c': 3 } I am looking for a na

avatar
Dusty
0 1 0 9
asked 07 September, 2021
55 votes
11 answers
1.4K views
Why is "1000000000000000 in range(1000000000000001)" so fast in Python 3?

It is my understanding that the range() function, which is actually an object type in Python 3, generates its

avatar
Elicia
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
498 views
How to print colored text to the terminal?

How can I output colored text to the terminal in Python?

avatar
Hallie
0 1 0 9
asked 07 September, 2021
58 votes
16 answers
507 views
50 votes
29 answers
3K views
How do I concatenate two lists in Python?

How do I concatenate two lists in Python? Example: listone = [1, 2, 3] listtwo = [4, 5, 6] Expected outcom

avatar
Tana
0 1 0 9
asked 07 September, 2021
54 votes
20 answers
1.4K views
How can I add new keys to a dictionary?

Is it possible to add a key to a Python dictionary after it has been created? It doesn't seem to have an

avatar
Venice
0 1 0 9
asked 07 September, 2021
64 votes
30 answers
721 views
57 votes
14 answers
1.9K views
Iterating over dictionaries using 'for' loops

I am a bit puzzled by the following code: d = {'x': 1, 'y': 2, 'z': 3} for key

avatar
Hilario
0 1 0 9
asked 07 September, 2021
62 votes
20 answers
903 views
How to make a flat list out of a list of lists

Is there a shortcut to make a simple list out of a list of lists in Python? I can do it in a for loop, but is

avatar
Karolyn
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
1.5K views
How to execute a program or call a system command?

How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from

avatar
Dusty
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
2.5K views
How do I merge two dictionaries in a single expression (taking union of dictionaries)?

I have two Python dictionaries, and I want to write a single expression that returns these two dictionaries, m

avatar
Thurman
0 1 0 9
asked 07 September, 2021
54 votes
27 answers
1.6K views
Does Python have a ternary conditional operator?

If Python does not have a ternary conditional operator, is it possible to simulate one using other language co

avatar
Mikki
0 1 0 9
asked 07 September, 2021
68 votes
30 answers
1.2K views
What does if __name__ == "__main__": do?

Given the following code, what does the if __name__ == "__main__": do? # Threading example import time, threa

avatar
Trudy
0 1 0 9
asked 07 September, 2021
55 votes
4 answers
624 views
What are the WordPress alternatives for Ruby on Rails?

What are the WordPress alternatives for Ruby on Rails? How do they compare to WordPress?    

avatar
Wilber
0 1 0 9
asked 07 September, 2021
54 votes
8 answers
413 views
PHP - Merging two arrays into one array (also Remove Duplicates)

Hi I'm Trying to merge two arrays and also want to remove duplicate values from final Array. Here is my

avatar
Keila
0 1 0 9
asked 07 September, 2021
57 votes
4 answers
830 views
Best place to insert the Google Analytics code

Where’s the best place to insert the Google Analytics code in WordPress, header or footer? I prefer

avatar
Arline
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
985 views
How to paginate with Mongoose in Node.js?

I am writing a webapp with Node.js and mongoose. How can I paginate the results I get from a .find() call? I w

avatar
Hilario
0 1 0 9
asked 07 September, 2021