Activity
Mon
Wed
Fri
Sun
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
What is this?
Less
More

Memberships

Data Alchemy

38k members • Free

8 contributions to Data Alchemy
Python Program
Hi All 👋 I'm stuck with this coding. Any help would be appreciated Heres the prompt In the next code cell, create a function get_expected_cost() that has two arguments: - beds - number of bedrooms - baths - number of bathrooms It should return the expected cost of a house with that number of bedrooms and bathrooms. Assume that: - the expected cost for a house with 0 bedrooms and 0 bathrooms is 80000. - each bedroom adds 30000 to the expected cost - each bathroom adds 10000 to the expected cost. For instance, - a house with 1 bedroom and 1 bathroom has an expected cost of 120000, and - a house with 2 bedrooms and 1 bathroom has an expected cost of 150000. Here is my coding. What am I doing wrong? # This function calculates the expected cost of a house # based on the number of bedrooms and bathrooms. # Base cost = 80000 # Each bedroom adds 30000 # Each bathroom adds 10000 def get_expected_cost(beds, baths): value = 80000 + (beds * 30000) + (baths * 10000) return value # Try to check with q1 (if you're in a course platform), or run manual tests try: q1.check(get_expected_cost) except NameError: # q1 is not defined, so we'll test the function ourselves print("q1 not defined – running manual tests instead:") print("1 bed, 1 bath:", get_expected_cost(1, 1)) # Expected: 120000 print("2 bed, 1 bath:", get_expected_cost(2, 1)) # Expected: 150000 print("0 bed, 0 bath:", get_expected_cost(0, 0)) # Expected: 80000
Reminder - Please, read the rules and use common sense.
Below there's a link to a pinned post named "Welcome to Data Alchemy - Start Here" where there are the basic rules for this group and some advice. (https://www.skool.com/data-alchemy/start-here?p=6e02d050) One of the three rules is "Don't sell anything here or use Data Alchemy as any kind of funnel", and I think it's self-explanatory. If your post is to sell whatever, this is not the place. If you want to sneak into other people's DM, this is NOT the place. One of the advices on that welcome post is named "Be Aware of Scammers" and reads: "Please be aware that this is a public group. Unfortunately, some people abuse the Skool platform to send DMs or post comments to trick people. This is the internet, so always do your own due diligence. Never automatically trust someone here on the Skool platform other than @Dave Ebbelaar's official account." Nobody offers free advice to get rich, so don't trust them. All of them are scammers, phishers, bots or members of some kind of MLM or Ponzi scheme that will cause you some kind of harm.
4 likes • Apr 11
Thanks so much for letting us all know
I had a bit of a chuckle
This came up on my feed this morning, thought I’d share the laughter 😊
I had a bit of a chuckle
3 likes • Apr 11
Isn't that true.
AI GIRLFRIEND?/?
https://www.youtube.com/shorts/uvHeI9f_ZYE
1 like • Apr 11
@Pierre-Henry Isidor We don't have time left haha
Help?!! ;)
I'm pretty much a beginner Can someone explain to me how to correct miss handling of data? I would appreciate any help given :) For example this here's the data set: d = {'timestamp': ['2021-11-11 12:00:00','2021-11-11 12:01:00','2021-11-11 12:02:00','2021-11-11 12:03:00','2021-11-11 12:04:00', '2021-11-11 12:05:00','2021-11-11 12:06:00','2021-11-11 12:07:00','2021-11-11 12:08:00','2021-11-11 12:09:00'], 'value1': [1,1,2,3,4,4,4,np.nan,6,6], 'value2': [10,10,9,7,np.nan,5,5,5,5,5] } df = pd.DataFrame(data=d) ## Fill in the missing data in the value1 column print(df)
1-8 of 8
Chrisanthi Augustin
3
33points to level up
@chrisanthi-augustin-2222
Learning about AI because it's become a little hobby of mine

Active 227d ago
Joined Apr 30, 2024
Powered by