3. Python 3 - Jupyter Tutorial (IPython 3)

preview_player
Показать описание
This tutorial is an introduction to using Python 3 in jupyter. We cover variable types, string formating, using lists, tuples and dicts. Using If statements and for, while loops. Finally we discuss functions and doc string.

Notebook Link:

Try Jupyter:
Рекомендации по теме
Комментарии
Автор

This is really an excellent tutorial. You covered everything important while kept it short enough to let me pick up everything fast. You are on the right track! Good work!

god-son-love
Автор

Thanks Roshan for these nice quick tutorial videos! I learned many things, and remembered many old school mathematics along the way.
By the way, the answer is 1378.

def nPk(n, k):
"""
This function returns the number of combinations with repetitions, i.e. selection of k number of samples from a sample space with n items where order doesn't matter and chosen sample could be repeated.

Parameters:

n, k as int

Returns:

nPk = (n+k-1)C(k) = (n+k-1)! / (k! * ((n+k-1)-k)!) = (n+k-1)! / (k! * (n-1)!)

"""
value = math.factorial(n+k-1) /
return value

Vaibik
Автор

Great tutorial for me to pick up those key points in a short time. Thank you!

amandaye
Автор

Thank you for the excellent tutorials ! :-)

MatthewVersaggi
Автор

Since I know that 2 different cards gives me 1326, I can just add the scenarios where 2 cards are the same: 1326+52=1378.

frankartanis
Автор

Is it 1378 ?

def binomial_coef_repetition(n, k):
value = math.factorial(n+(k-1)) / (math.factorial(k) * math.factorial(n-(k-1)))
return value

binomial_coef_repetition(52, 2) = 1378

reywilli