Challenge: Dosage Calculator for Multiple Patients
Building on your previous experience with function-based dosage calculations and handling patient data, you are now ready to tackle a more complex scenario: calculating medication dosages for multiple patients at once. In real pharmacy practice, you often need to process a list of patients, each with individual characteristics such as name, weight, and prescribed dose per kilogram. Efficiently iterating through this data and producing accurate results is essential for patient safety and effective workflow management.
Swipe to start coding
Write a function that processes a list of patient dictionaries, each containing name, weight_kg, and dose_per_kg. The function must:
- Calculate the total dose for each patient by multiplying
weight_kgbydose_per_kg. - Return a list of dictionaries, each with the patient's
nameand theircalculated_dose. - Print the name of the patient with the highest calculated dose.
Рішення
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Чудово!
Completion показник покращився до 4.76
Challenge: Dosage Calculator for Multiple Patients
Свайпніть щоб показати меню
Building on your previous experience with function-based dosage calculations and handling patient data, you are now ready to tackle a more complex scenario: calculating medication dosages for multiple patients at once. In real pharmacy practice, you often need to process a list of patients, each with individual characteristics such as name, weight, and prescribed dose per kilogram. Efficiently iterating through this data and producing accurate results is essential for patient safety and effective workflow management.
Swipe to start coding
Write a function that processes a list of patient dictionaries, each containing name, weight_kg, and dose_per_kg. The function must:
- Calculate the total dose for each patient by multiplying
weight_kgbydose_per_kg. - Return a list of dictionaries, each with the patient's
nameand theircalculated_dose. - Print the name of the patient with the highest calculated dose.
Рішення
Дякуємо за ваш відгук!
single