When we roll a fair die, why is 6 the expected number of rolls after which we get our first 3? When we roll a fair die, why is the expected number of rolls after which we get our first 3 (or any number from 1 to 6) is 6 rolls?
This code finds the expected number of rolls after which we get our first 3(or any other number from 1 to 6) when we roll our die 10000 times:
s=0
p=1/6
for i in range(1,10**4):
  s+=((i*p)*((1-p)**(i-1)))
print(s)

output:
6.000000000000001

It makes some sense that after (approximately) 6 rolls I would have gotten all the 6 numbers on a fair die, but can someone explain it in a more intuitive way and also give a mathematical proof?
Why is the expected number of rolls after which we get our first 3, in 10000 rolls, the reciprocal of the probability of getting a 3 in 1 roll?

For a nonnegative integer-valued discrete random variable $X$, it is a standard result (see e.g. here on stats.SE) that
$$E[X] = \sum_{n=0}^\infty P(X > n).$$
When $X$ is a geometric random variable with parameter $p$ that takes on values $1, 2, 3, \ldots$ (which is the case here since $X$ is the number of the trial on which $3$ occurs for the first time), we have that
\begin{align}
E[X] &= \sum_{n=0}^\infty P(X > n)\\
&= 1 + (1-p) + (1-p)^2 + (1-p)^3 + \cdots\\
&= \frac{1}{1 - (1-p)}\\
&= \frac 1p
\end{align}
without the need for simulations as in BruceET's answer or taking derivatives and worrying about interchanging the order of differentiation and summation etc as in the Wikipedia article referenced in BruceET's answer.
Intuitively, if $3$ has probability $\frac 16$ of occurring,  relative frequency notions say that over a long run of $N$ trials, $3$ should occur on roughly $\frac N6$ trials, and so the average spacing between successive occurrences of $3$ should be $5$, that is, on average, every sixth trial results in a $3$.
