flip coin online code example
Example 1: coinflip
import random
random.choice('Heads', 'Tails')
Example 2: coin flip
#Ruby
def coin_flip(num_of_flips = 1)
array = ["heads","tails"]
num_of_flips.times do
puts out_come = array[rand(0..1)]
end
end
coin_flip() # You can set the number of times you flip it ;)