"Sound Heartbeat"

Soundheartbeat.com - ranking and value

Python Program

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.

SEVA:

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”)

random_int=random.randint(0,1)

if random_int == 0:

print(“Heads”)

else:

print(“Tails”)

Practice daily

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

program 3

program 2

chao

happy coding

#learn #python


1 Comment

10 Basic Steps To Become A Programmer | Sound Heartbeat · September 4, 2021 at 10:26 AM

[…] Reference to Learn python from base project […]

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!
en_GBEnglish (UK)