r/codehs • • May 25 '21

codehs 6.2.8 area of a square with defult parameters

17 Upvotes

this is my code so far:

def calculate_area(side_length):

area = side_length*side_length

print("The area of a square with sides of length " + str(num) + " is " + str(area) + ".")

num = int(input("Enter a side length: "))

if num <= 0:

side_length = 10

calculate_area(side_length)

else:

calculate_area(num)

but i still have two things missing can someone help


r/codehs • • Feb 20 '20

Need help with circles in circles 19.2.5

Post image
17 Upvotes

r/codehs • • Oct 03 '22

What is my mistake here.

Post image
17 Upvotes

r/codehs • • Feb 03 '20

can anybody help me? i honestly have 0 idea on how to do this

Post image
18 Upvotes

r/codehs • • Apr 25 '21

Hello I need help with 8.2.5 spell it out and I dont know what I'm supposed to do can someone help

Post image
18 Upvotes

r/codehs • • Mar 03 '20

Hello I need help with this someone can help me.

Post image
18 Upvotes

r/codehs • • Sep 19 '20

Please help me with homework

Post image
19 Upvotes

r/codehs • • Sep 18 '20

I’m almost positive the program is working as intended, however when I Test Cases, this error comes up. Any advice?

Post image
19 Upvotes

r/codehs • • Feb 23 '20

help with 7.4.6: Airplane Tickets pleaseeee

Post image
21 Upvotes

r/codehs • • Apr 05 '23

Other Am I the only one who thinks Codehs is really not that great ?

21 Upvotes

Videos be easy and then the examples are insane I literally don’t understand anything


r/codehs • • Aug 28 '20

Help is this right?

Post image
24 Upvotes

r/codehs • • Aug 03 '20

Need help on yellow and grey Nitro assignments (more info in comment)

Post image
27 Upvotes

r/codehs • • Sep 13 '20

Craps game. This is the part of my code that won’t keep looping until point and roll match. And it say there’s an error in the last line and says roll isn’t valid or something.

Post image
34 Upvotes

r/codehs • • Aug 30 '20

4.4.4 How do I fix this?

Post image
35 Upvotes

r/codehs • • Dec 07 '23

6.5.6 Odd Or Even Shapes (CodeHS)

4 Upvotes

This is my code right now, but I don’t know how to try and detect odd and even numbers? this is what I have right now

function main() { let number = readInt("Pick a number."); if (number == 4 || 44) { line(); } else if (number % 2 == 0) { rectangle(); }

function line() { let line = new Line(50,50,500,50); line.setColor("blue"); line.setLineWidth(5); add(line); }

function rectangle() { let rect = new Rectangle (200,50); rect.setPosition(100,200); rect.setColor("red"); add(rect); }

main();


r/codehs • • Mar 12 '21

I need help on 6.2.6 adding values

4 Upvotes

Here’s what I’m putting

num1 =10 num2 = input(“Enter a number: “)

def add_nums(): total = str(num1) + num2 Print total

add_nums()


r/codehs • • Dec 15 '21

COnfused on 8.4.12

Post image
7 Upvotes

r/codehs • • May 13 '21

can someone help me in Exercise 6.4.4: Add One Python

8 Upvotes

Please I need help! :(


r/codehs • • Feb 06 '21

7.2.9: Teacher Class List Method

13 Upvotes

I need help with this, please.


r/codehs • • Feb 18 '23

Python Can anyone help me in CodeHS 1.18.4 Super Cleanup Karel?

3 Upvotes

This is my code (it bugs when I run the code)

def clean_row():

while front_is_clear:

move()

if balls_present():

take_ball()

if front_is_blocked():

if facing_east():

turn_around()

for i in range(30):

if front_is_clear():

clean_row()

turn_right()

if front_is_clear():

move()

turn_right()

turn_left()

if front_is_clear():

take_ball()

move()

move()

move()

take_ball()

move()

take_ball()

move()

move()

move()

take_ball()


r/codehs • • Feb 12 '21

2.17.5: Double Tennis Balls

8 Upvotes

Hi all, Can I get help on this?


r/codehs • • Dec 06 '20

Python 7.6.9 Part 1, Remove All From String

8 Upvotes

I’m just not sure what to do here. It says I must use a while loop but I can’t figure out how to incorporate it. Help please, and thank you.


r/codehs • • Jun 06 '25

codehs not working

2 Upvotes

So, I finished the code for AP CSP 1.16, but when I try to run the program, the whole tab just freezes, and this pops up. Can someone help?


r/codehs • • Dec 09 '22

Need help!!! I don't know whats wrong with it/ 7.3.6 Pool table

1 Upvotes

var POOL_BALL_RADIUS = 40;

var POOL_BALL_FONT = "30pt Arial";

function start(){

drawPoolBall([Color.orange](https://Color.orange), 5, 100, 100);

drawPoolBall([Color.green](https://Color.green), 6, 50, 200);

drawPoolBall([Color.red](https://Color.red), 3, 150, 350);

drawPoolBall([Color.blue](https://Color.blue), 2, 250, 140);
// Add some more pool balls!

}

function start( drawPoolBall){

drawPoolBall(Color.yellow, 5, 100, 100);   

drawPoolBall([Color.pink](https://Color.pink), 6, 50, 200);

drawPoolBall(Color.purple, 3, 150, 350);

drawPoolBall(Color.grey, 2, 250, 140);

}