heads or tails in python

Heads or Tails in python | Python Bootcamp

Introduction

In this post, you will learn how to find heads or tails using the random function and below is the source code of the program and also below is the video format of the post, check it out ????????

Heads or tails in python source code

Firstly, I used the random module and if you don’t know about the random module [click here]

Then I used the randit function, which selects a random integer and then I wrote the if statement and entered the variable equals to 1 and I print the if statement as heads and then I print the else statement as tails.

* Random function does not work python 3 and below so, you need to install the random function using pip install random


Also Read: Celsius to Fahrenheit in python

Also Read: Random module in python

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions or brave browser to block ads. Please support us by disabling these ads blocker.Our website is made possible by displaying Ads hope you whitelist our site. We use very minimal Ads in our site

 

Scroll to Top