1 daily python program is just to add same value daily into your learning skill . Python is one of most demanding skill now-a-days hence, one should definitely learn python.
Here, in our daily python dose, we are going to write a code that will give us Coin Toss which is either “HEADS” or TAILS”.
let’s learn how do we use python code to get our “Toss”
Instruction to the code:
Let’s Toss the Coin to see , who will play first.
choice = Heads or Tails
first thing is when we flip the coin it’s either Heads or Tails.
so, we would import Random Function , to test our flip.
In python Random function is predesignated function to test random number. The Mersenne Twister is a pseudorandom number generator (PRNG) in python programming. To sharpen your in random number function you can also click this reference.
Code of the Program:
print(“Heads or Tails”)
if random_int == 0:
To daily learn python , use this link.
it is very good place to learn python and practice daily for the beginners.
look at our previous practice