When I'm iterating over an iterator object is there a way to know what index i'm at by calling some function on the object?
How do I access the index in a for loop like the following?  ints = [8, 23, 45, 12, 78] for i in ints:     print('item #{} = {}'.format(???, i))   I want to get this output:  item #1 = 8 item #2 = 23 item #3 = 45 item #4 = 12 item #5 = 78   When I loop through it using a for loop, how do I access the loop index, from 1 to 5 in this case?
Short story; war where speed of time changes with distance from front line Can Muggles publicly establish the existence of a magical community? How can I String.Format a TimeSpan object with a custom format in .NET? "Was" or "were" in subjunctive clauses I'm not a native english speaker, so even though I'm decently proficient at it, I don't really "know the rules" sometimes, and this is one that's been confusing me for a long time.  Which one is correct in each sentence?     If the movement [was/were] to continue uncorrected, the tower would   one day topple.      If I [was/were] rich, I would buy a yacht.   NOTE: I care not only about the case of "I", but also "she", "them", "it", etc, as in the example of the tower. Would it be any different if instead of the tower, it'd be me who'd topple if uncorrected?  I'm pretty sure it's "were" in both cases. That's what they taught me, I think. I started to doubt when I saw a lot of "was", but it sounded like the typical intentional mistake used "stylistically". ("If I was a rich girl...")  Then I saw it some more and thought it came down to an American/British English difference (I was taught British, in theory, and most of what I read is American).    But that tower sentence came straight from "The Guardian"...  When do you use was and when do you use were? How should we understand the teletransportation thought experiment? Website is under maintenance - how to restrict access? Group algebra ever a field? Let $G$ be a group. Let $K$ be any field and consider its group algebra $K[G]$. It is known that if $G$ is a finite group then $K[G]$ is never a field. Or even if $G$ is not finite: if $G$ has at least one non-trivial torsion element, then $K[G]$ is not a field.  Question: Do there exist infinite groups $G$ such that $K[G]$ is a field or a division ring? spectral radius in normed space is subadditive. I am reading the book "characterizations of c*-algebras" by Doran and Belfi. On the page 299, the book reads "It can also be shown that if $xy=yx$, then $\nu(x+y)\le\nu(x)+\nu(y)$." The definition of $\nu$ is as follows: in normed algebra,  $$\nu(x)=\limsup_{n\to\infty}\|x^n\|^{\frac1n}$$  Note that the algebra is not assumed to be complete and is also not assumed to be complex scalar(we can have real scalars)  This is my trial: I just tried to mimic the proof of the Minkowski inequality, but failed.  Thank you Does anyone know what the Inverse Cumulative Distribution Function of Normal Distribution is? Does it have a closed form expression? I did not find any good answer using Google. See code:   var file1 = "50.xsl"; var file2 = "30.doc"; getFileExtension(file1); //returns xsl getFileExtension(file2); //returns doc  function getFileExtension(filename) {     /*TODO*/ } Steps for going from Polyakov action to low-energy effective action (SUGRA?) in String Theory A lot of string-theory questions have been asked here. This one is, hopefully, different in that this inquiry is specific and the expected answer would be more mathematical than philosophical in character.  To give some context, I'm familiar with LQG, QFT etc. I'm a beginner in CFT and string-theory. On reading papers on AdS/CFT and String Theory the following sentence often appears: "The low-energy effective action for $x$ dimensional ST of type $y$ reduces to that of supergravity (SUGRA) in $z$ dimensions with matter fields of types $a$, $b$ and $c$".  The $64,000 dollar question any noob, such as me, wants answered is what are the mathematical/technical steps or arguments which lead us from the fundamental action of string-theory (the Polyakov/Nambu-Goto action) to a low-energy effective description. Of course, I might be asking a question for which the only concise answer is: "go read GSW". Here's hoping otherwise ;) Prove that $ n^3 + 5n$ is divisible by 6 for all $n\in \textbf{N}$ Prove that $ n^3 + 5n  $ is divisible by 6 for all $ n \in \textbf{N} $.  I provide my proof below. I know that non-married lovers address each other by saying “This is my girlfriend/boyfriend.” I know that married couples address each other by calling “my wife/husband”.  I also know that gay lovers who are not married (yet?) address each other by saying "my boyfriend" (for gays) and "my girlfriend" (for lesbians).  But if they are married, how do they address each other?  And how do we describe them? I mean if they are gays, are they “husband and husband” or “husband and wife” (one of them acts like the wife)? And if they are lesbians, are they “wife and wife” or “husband and wife” (one of them acts as the husband)?  I know they can be referred to as a gay couple or gay lovers from , but I couldn't find the answer to address each of the two. Will Windows 10's reset delete my Linux partitions? I want to use the "reset my PC" feature of Windows 10 to wipe the data on my Windows partition. But I have also a Linux system installed, which I want to keep.  Will Windows 10's full reset wipe all my disk, or just Windows's partitions ? Is there a way to view Google Chrome browsing history past three months ago? I'm trying to find a page I looked at months ago but it looks like it's disappeared off the face of the planet. I thought I would have better luck looking through my Google Chrome browsing history, but I can't see history past September. Can I force Google Chrome to display history further into the past? Can I retrieve the history manually from a directory? Is the history data gone? Proof of a formula for the power set of a union of two sets I need to prove that:  $2^{A\cup B} =\left \{ X\cup Y \mid X\in 2^{A}, Y\in2^{B} \right \}$  Note that $2^{A} = P(A)$ (The power set of A).  While I can prove the Right - Left direction fairly easily, It seems very hard for me to prove the Left - Right direction. Can I get some help with that?  How do I prove that $t\in2^{A\cup B}$ makes $t\in \left \{ X\cup Y \mid X\in 2^{A}, Y\in2^{B} \right \}$? Whenever I start an application like Terminal or Preview, they are always opened as a small window on the top left corner of the screen. Is there any way to set them to open in the center of the screen? Preferably maximized too? How do I detect unsigned integer multiply overflow? Setting up a download page requiring a user to fill a form before downloading anything In the Drupal site I'm setting up, there's a Download page containing several links to download softwares.   What is the best way to "bind" the softwares to the page, put them anywhere online and place a direct link in the page?   Does anyone know a module that would show a contact form when a user clicks one of the "Download" buttons, preventing him from downloading unless he properly completes the form?  Our goal is to receive the contact information of any person downloading our software. What is the term for a sentence which reads same forwards and backwards? Please note, I'm not asking for a palindrome.  I mean to say that only the word  order is rearranged, not the actual spelling of the word.  An example might be as follows:     First ladies rule the State and state the rule: ladies first.