CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day46-60/code/hellodjango/first/views.py
Views: 729
1
from random import sample
2
3
from django.shortcuts import render
4
5
6
def show_index(request):
7
fruits = [
8
'Apple', 'Orange', 'Pitaya', 'Durian', 'Waxberry', 'Blueberry',
9
'Grape', 'Peach', 'Pear', 'Banana', 'Watermelon', 'Mango'
10
]
11
return render(request, 'index.html', {'fruits': sample(fruits, 3)})
12
13