Question: whats wrong with this code ( def main ( ) : # Prompt the user for input num _ pirates = int ( input (

whats wrong with this code (def main(): # Prompt the user for input num_pirates = int(input("How many pirates: ")) num_units = float(input("How many units: ")) # Step 1: Calculate Yondu's share yondu_share = num_units *0.13 # Step 2: Calculate the remaining units after Yondu's share and then Peter's share remaining_units = num_units - yondu_share -3* num_pirates # Subtracting 3 units per pirate peter_share = remaining_units *0.11 # Step 3: Calculate the crew's share per person total_share = remaining_units + yondu_share + peter_share +3* num_pirates # Adding 3 units per pirate back crew_share_per_person = total_share / num_pirates # Yondu, Peter, and Crew's share rounded to 2 decimal places yondu_share_rounded = round(yondu_share, 2) peter_share_rounded = round(peter_share, 2) crew_share_rounded = round(crew_share_per_person, 2) # Print

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!