Chapters
Python114 chapters

Exercises

Random Numbers

3 tasks. Write the code, press Check, and the page runs it against a real Python interpreter.

Exercise 1

Seed twice with the same number and show the sequences match.

Python
import random
# print True
Exercise 2

Deal three different cards from the deck.

Python
import random

deck = ["a", "b", "c", "d"]
# take three with no repeats, then print how many are unique
Exercise 3

Generate a token safely. Print its length.

Python
# print 32