Codingbat - make_pi (Python)

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

i wanted to do in a diffrent way, 22/7, then change float to a list. is it posssible?
\

shivajivishnoi
Автор

Nice work! LoL my solution was way more complicated:

pi = 3.1416

def make_pi():
a = str(pi)
digits = []
for i in a:
digits.append(i)

b = [int(a[0]), int(a[2]), int(a[3])]
return b

MFM