Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Having some trouble with this python question. An answer would be greatly appreciated! #Imagine you're playing a game in which every action you #take grants

Having some trouble with this python question. An answer would be greatly appreciated!

#Imagine you're playing a game in which every action you #take grants you some number of experience points. There is #an item called a Lucky Egg that, when used, doubles the #number of experience points you earn. The company behind #the game also runs occasional events where they increase #how many experience points you earn for each action by 50%, #100%, or even 200%. # #Write a function called find_total_exp. find_total_exp #should have one positional parameter, a base number of #experience points. It should also have two keyword #parameters: lucky_egg, whose default value is False, and #event_mulitplier, whose default value is 1. # #The function should return the number of experience #points earned based on these two variables. The base number #of experience points should always be multiplied by the #event multiplier, and then doubled if lucky_egg is True. # #You should convert the final result from a float to an #integer before returning it. This will automatically round #down.

#Add your code here!

#Below are some lines of code that will test your function. #You can change the value of the variable(s) to test your #function with different inputs. # #If your function works correctly, this will originally #print: #100 #200 #150 #300 print(find_total_exp(100)) print(find_total_exp(100, lucky_egg = True)) print(find_total_exp(100, multiplier = 1.5)) print(find_total_exp(100, lucky_egg = True, multiplier = 1.5))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions