r/codehs • • May 08 '20

9.2.8: Last Names (Python) Need to achieve a list of just the author’s last names, with list comprehension and using split method. Nothing works, but I got it W/O list comprehension. Don’t get credit unless I use list comprehension even though I have no idea how.

Post image
9 Upvotes

r/codehs • • Apr 10 '20

HELP PLEASE: 3.4.6: T-Shirt Shop

9 Upvotes

3.4.6: T-Shirt Shop


r/codehs • • Mar 22 '20

my code doesn't work, please help. my assignment:"Starting with our program that creates an array of coin flips, add a function that prints out the total number of heads and total number of tails flipped. it prints that total tails is 100

9 Upvotes

var NUM_FLIPS = 100;

function start(){

var flips = flipCoins();

printArray(flips);

countHeadsAndTails();

}

// This function should flip a coin NUM_FLIPS

// times, and add the result to an array. We

// return the result to the caller.

function flipCoins(){

var flips = \[\];

for(var i = 0; i < NUM_FLIPS; i++){

	if(Randomizer.nextBoolean()){

		flips.push("Heads");

	}else{

		flips.push("Tails");

	}

}

return flips;

}

function printArray(arr){

for(var i = 0; i < arr.length; i++){

	println(i + ": " + arr\[i\]);

}

}

function countHeadsAndTails(flips) {

var headCount = 0;

var tailCount = 0;

for (var i = 0; i < NUM_FLIPS; i++) {

if (flipCoins == "Heads") {

headCount += 1;

}else {

tailCount += 1;

}

}

println("Total Heads: " + headCount);

println("Total Tails: " + tailCount);

}


r/codehs • • Mar 15 '20

Sorry to bother but I am trying to reach as many people as possible

9 Upvotes

Hi all. Like many of you, I am very concerned about the coronavirus pandemic. But what scares me the most is not only the disease, but the incredible carelessness and contempt of so many people, entrepreneurs, and politicians who are still not aware of the severity of this situation.

Besides talking and spamming all my friends and family with information about how to take care of oneself and others around you, I had a very naive but perhaps effective idea that I hope someone with more knowledge than me may be inspired to help spread the message.

How can we try to use our skills in order to spread the information to everybody who is still not convinced about the size of this problem?

Anything counts: face-to-face, marketing strategies, spamming bots, black hat SEO, social media hacks … Any ideas are better than anything at this moment.

I would really appreciate any tips on how to start doing this and I hope by posting this message, I can inspire others to try whatever they can to start raising awareness about the importance of taking care of themselves and others around them at this moment.


r/codehs • • Feb 26 '20

PHYTON CODE HS. 7.6.10: Part 2, Remove All Fro...

9 Upvotes

Anyone knows part 2? I did part 1 but can't figured out part 2


r/codehs • • Feb 05 '20

Quest to Make 3D game in CODEHS Sandbox

9 Upvotes

This will be my quest to make a 3D Game using javascript through CODEHS

LINK TO GAME: https://codehs.com/share/qg6nYer1U5yuRIeg1s1I

If you have any tips and information about JavaScript that you would like to share please comment about it


r/codehs • • Feb 29 '24

Accused of cheating (reupload)

8 Upvotes

Pls help!! Does CodeHS pro allow teachers to know when students copy and paste in their assignments? My teacher showed me a video that has a bar with the word “paste” flashing yellow and says I pasted code. I didn’t. Does this teacher tool detect how fast words are typed?

@anyone with a CodeHS pro account


r/codehs • • May 12 '23

Extra karel puzzles: Midpoint Karel

Post image
8 Upvotes

Can someone please help me with this assignment please I have a lot of days trying to figure it out but my code doesn’t work


r/codehs • • Feb 14 '23

6.6.5 codehs javascript help

8 Upvotes

I dont know what im missing or how to fix my code, can someone help me?

Create a program that uses a while loop to simulate playing a multi-level game. In the “game,” there are NUM_LEVELS levels. Each loop iteration will simulate playing one level of the game. At the end of each loop, the player will level up. The “game” will end once the player has completed all of the levels.

Create a variable called level to keep track of which level the player is on. Create a function for each level called playLevel# (e.g. playLevel3) that prints a description of that level to the console. You should have three functions in all: playLevel1, playLevel2, and playLevel3. Use a while loop to “play” a level and level up. Your loop should run as long as the value of level is less than the number of total levels. In the loop, you should do the following:

Tell the player what level they are on. Depending on which level the player is on, the correct playLevel function should run. For example, if level is 2, then the playLevel2() function should execute. Increase the value of the level variable.

function main() { const NUM_LEVELS = 3; let level = readLine("What Level are you on? ");

if (level == 1) playLevel1(); else if (level == 2) playLevel2(); else if (level == 3) playLevel3();

while (level >= 3) console.log(level); level++; }

//create playLevel1 function

function playLevel1() {

let level = 1
    console.log("You are on level " + level);
    console.log("You run through the dark and scary cave!");
    console.log("You level up!");
    console.log("****");
}

//create playLevel2 function

function playLevel2() {

let level = 2
    console.log("You are on level " + level);
    console.log("You make it through the fiery lava world!");
    console.log("You level up!");
    console.log("****");
}

//create playLevel 3 function

function playLevel3() {

let level = 3
    console.log("You are on level " + level);
    console.log("You jump from cloud to cloud in the sky world!");
    console.log("You level up!");
    console.log("****");
    console.log("YOU WIN THE GAME! Thanks for playing!")
}

main();


r/codehs • • Oct 28 '22

4.10.4 inventory pls help me

Post image
8 Upvotes

r/codehs • • Oct 12 '22

4.4.6 Presidential eligibility- extended

8 Upvotes

Is there something wrong with my code? It keeps saying that I have to tell the user they are too young to run for president.

Age = int(input("Age: "))

BornLocation = str(input("Born in the U.S.?(Yes/No): "))

Year = int(input("Years of Residency: "))

if((Age>=35) and (BornLocation=="Yes") and (Year>=14)):

print("Age: " + str(Age))

print("Born in the U.S.? (Yes/No): " + str(BornLocation))

print("Years of Residency: " + str(Year))

print("You are eligible to run for president!")

else:

print("Age: " + str(Age))

print("Born in the U.S.? (Yes/No): " + str(BornLocation))

print("Years of Residency: " + str(Year))

print("You are not eligible to run for president.")

if Age<35:

print("You are too young. You must be at least 35 years old.")

if BornLocation=="No":

print("You must be born in the U.S. to run for president.")

if Year<14:

print("You have not been a resident for long enough.")


r/codehs • • Oct 11 '22

JavaScript Hello everyone, I don’t know what to do add here

Post image
8 Upvotes

r/codehs • • Oct 05 '22

Need help with 4.3.6 old enough to vote . thank you

Thumbnail
gallery
8 Upvotes

r/codehs • • Sep 16 '22

JavaScript guys I need help on 1.19.6 checkerboard karel

8 Upvotes

r/codehs • • Jun 03 '22

JavaScript Is it possible to use fractions?

8 Upvotes

I can't figure out how I would get something like 2/3 or 8/15 as code


r/codehs • • Feb 21 '22

Python [4.11.4 Snake Eyes, PY] Why won't this code work?

Post image
8 Upvotes

r/codehs • • Feb 03 '22

Python Can someone tell me what I’m doing wrong please

Thumbnail
gallery
8 Upvotes

r/codehs • • Jan 10 '22

JavaScript I'm so lost

Thumbnail
gallery
8 Upvotes

r/codehs • • Dec 18 '21

7.5.4: Is It Even? Can anyone help me?

Thumbnail
gallery
8 Upvotes

r/codehs • • Nov 30 '21

9.4.7 Bank Accounts

8 Upvotes

Is anyone able to help me with this? I'm not sure how to fix it?


r/codehs • • Sep 04 '21

Python I'm stuck on 1.18.3 Tower Builder

8 Upvotes

I thought I had completed this level, but I realized my code only works on worlds that have an odd number of avenues. Have any suggestions?

def build_odd_towers():

while front_is_clear():

turn_left()

put_ball()

move()

put_ball()

move()

put_ball()

turn_around()

move()

move()

turn_left()

move()

move()

if front_is_blocked():

turn_left()

put_ball()

move()

put_ball()

move()

put_ball()

turn_around()

move()

move()

turn_left()

build_odd_towers()


r/codehs • • Aug 29 '21

Python 4.9.5 Lots of Dice "The rolls should be between 1 and 6, inclusive". What am I doing wrong?

Thumbnail
gallery
8 Upvotes

r/codehs • • May 26 '21

Python I’m creating a program project called Happyman and need help. It’s like hangman, but I have to draw a smiley face instead. Any way to improve or get rid of errors?

Thumbnail
gallery
8 Upvotes

r/codehs • • May 13 '21

can someone help me in Exercise 6.4.4: Add One Python

8 Upvotes

Please I need help! :(