Write a program with a function called flip() that has one parameter representing the number of times a coin will be flipped. The flip()
function will count the number of heads and tails that result from the coin flip. HINT: Use the random function to represent
heads as 0 and tails and 1. The flip() function should return both the number of heads and tails that were counted (you should return two values).
Include main-line logic that will ask the user how many times they wish the coin to flip, it should also call the flip() function and handle the return
def main ():
'''This is our mainline logic.'''
num_of_flips = int(input("How many times do you wish to flip the coin? "))
num_heads, num_tails = flip (num_of_flips)
for i in range (num_of_flips):
flip = [login to view URL] (0, 1)
if flip == 0:
num_heads =+ 1
if flip == 1:
num_tails =+ 1
23 фрилансеров(-а) готовы выполнить эту работу в среднем за $21
Hi, thanks for your posting. I'm Python expert and I can complete it for you within only 1 hours. Please message me to discuss more details. Best, Tam
Hi, I am a python programmer, I have looked into the code and understands the logic very well, I can help you to complete the entire function, please send me a message to discuss further details. Thanks
Hi, I am a python developer with more than 2 years of experience. I have made many projects through python in past. So I think I can do your work. Let's discuss more over chat. Please have a look at my profile.
I can send you a solution right now and help with such scripts from time to time, and explain how to make them better. And also recommend books for better learning.
i can help you with your work. Looking forward to work for you. I am a python developer from Infosys Ltd. You just need to change one line and the code will work fine as you are wishing it to work.
Hi! I am interested in solving this problem based on the given premises. I have idea how to display the expected result. I will be attentive to this proposal.
This is pretty straightforward and most of the code/pseudocode is already given in your message. Hence I am not sure if there is much to do here. Am I missing something ?