I have a list of strings, strs. I want to create a new list of strings that has 60 items, all equal to the same random string from the first list. When I do random.choice(strs) * 60 I just get one long string.
So I tried [random.choice(strs)] * 60 and it worked. So that means it's right, right?
I would like to know how i can initialise an array(or list), yet to be populated with values, to have a defined size.
for example in C:
int x[5]; /* declared without adding elements*/
How do i do that in python?
Thanks.
[ SmokeDetector ] URL in title, bad keyword in body, bad keyword in title, link at end of body, link following arrow in body, pattern-matching website in body, pattern-matching website in title: http://rxrepairhelp.com/brainplus-iq/ by luizlo on security.stackexchange.com
So when we view reputation, there is graph view. However, it seems to be off by a day. Here's what I mean:
I'm sure 70 + 20 + 15 is not 15. Its 105, which is what we see below:
And 40 + 10 is NOT 105, unless you did this :)
Anyways 40 + 10 is 50:
So yeah. Did you do what that post on co...
@TinyGiant @Braiam y'all are making the same mistake again: define certain types of posts as "nonsense" then define rules for nonsense then get uneasy about whether or not your rules apply to everything you've given that name.
See my edit, please - if the post has literally no meaning whatsoever, not a single word in any language, then you really don't need to think so hard about it.
Conversely, if the post means something then stop trying to shove it into the bucket with the cat puke and make a decision based on what it says.
Your cat pukes in a bucket? I am in awe of your cat wrangling skills. Mine does it on the carpet, literally less than a body length from the tile floor.
Hm, first time I see a Smokey report for Politics.SE... one would expect that the site, by the nature of its subject, would attract a fair number of trolls/angry people.
@Shog9 I was in the "most efficient method to get rid of this crap" camp... not trying to rationalize or guess OP intentions, which is why offensive is my pet tool
TRE (I) was a success . . . depending on how you define it, but the majority agree, hope or guess.
I could've just gone on and thrown in a new plan of attack since there are only so many ways to get a list of questions and edit their tags and stuff, but I first wanted to see what you guys find f...
@rene I suppose that depends on one's romantic interests. Although, when people fall from the sky, they are probably too busy needing hospital care to be romantic.
This picture inspired a contest between a few of my friends to rewrite this code in more proper OO style.
This is what I have come up with.
Any thoughts:
public enum CoffeeKind
{
Black = 1,
Cappuccino,
Espresso
}
public class Coffee
{
//Measured in celcius
public int Tem...