make a python script that prints how many fingers im holding up
- User
make a python script that prints how many fingers im holding up
- Assistant
Sure! Since I can't actually see how many fingers you're holding up, here's a fun Python script that will randomly guess the number of fingers you're holding up (from 0 to 10):
import random def guess_fingers(): fingers = random.randint(0, 10) print(f"I think you're holding up {fingers} finger(s)!") guess_fingers()How the Script Works
-
Import the
randommodule: This module allows us to generate random numbers, which we'll use to guess the number of fingers. -
Define the
guess_fingersfunction: This function generates a random integer between 0 and 10 using .
-