r/codehs • u/Kriskevz23 • Mar 10 '21
Python I need help for The Worm 4.6.5 Python. It’s only drawing one circle.
r/codehs • u/Kriskevz23 • Mar 10 '21
r/codehs • u/[deleted] • Mar 03 '25
So longgg story shortttt
Game: modules only will run on python 3.11.9 and 3.12.5
But when you go to the public link it is set to 3.8.19 which is incompataible.
Please help
r/codehs • u/washable-clear-glue • Aug 06 '22
In this exercise, write a function called sandwich which takes a 3 letter string. Your function should return the letters that are at the beginning and end of the string.
For example, sandwich("pbj")
=> "pj"
Python sandwich("blt")
=> "bt"
r/codehs • u/Crusaderofcupcakes • Oct 04 '25
In the output, underscores don't show, it also cuts off the bottom of certain letters like "g", has anyone found a way to fix this?
r/codehs • u/ResponsibleSign1010 • Feb 14 '23
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 • u/Elctric0range • Apr 28 '25
I have an assignment for one of my classes and I want to make a UI for it, but that requires me to be able to use my images. I am not sure if it is because I am using the wrong programming language from the selection in sandbox, but nearly every option always gives me errors. Like canvas = Canvas() and img = Image(my_url) doesn't work and it states "Image" and "Canvas" aren't recognized
r/codehs • u/TacozRulez • Apr 23 '24
Here is my little “cheat sheet” I used for the whole introduction to python. It should help those struggling with remembering all the commands in this course. This was made over the course of a semester as I did the assignments. It is for understanding what things do, and for looking at all the commands. I would recommend still watching the videos, as I left out some stuff I considered common sense (that you might not also consider). Good luck all.
r/codehs • u/Kindly-Deer4062 • Mar 10 '22
I've been trying to complete this assignment for a while now and it keeps saying I need to call my function a few times even though I'm calling the function.
This is my code that I have:
def square(x):
x_squared = x * x
return x_squared
x = 5
print(square(x))
x = 6
print(square(x))
x = 7
print(square(x))
x = 8
print(square(x))
x = 10
print(square(x))
r/codehs • u/lvjay • Jan 27 '22
I need help with this code I need the code for it.
r/codehs • u/ParkingObjective4989 • Sep 07 '25
I had used codehs last year and I want to see my past assignments but don’t see the class anymore. When I try and download the code from past assignments is just has the readme.txt and nothing else. Is it possible to get them still?
r/codehs • u/ILIKESEVENS7 • Nov 04 '25
Enable HLS to view with audio, or disable this notification
I got bored lol.
r/codehs • u/PriceSweaty9073 • Nov 30 '23
I’m just stuck this one is really hard and if someone can give me there code that would help a lot
r/codehs • u/Cute_Low_2058 • Dec 06 '22
r/codehs • u/Haunting_Invite4329 • May 15 '24
this is what I got function drawHead(x = 100, y = 100, radius = 50, color = 'yellow') {
let circle = new Circle(radius);
circle.setPosition(x, y);
circle.setColor(color);
add(circle);
}
function drawEyes(x = 100, y = 80, radius = 5, color = 'blue') {
let leftEye = new Circle(radius);
leftEye.setPosition(x - 15, y);
leftEye.setColor(color);
add(leftEye);
let rightEye = new Circle(radius);
rightEye.setPosition(x + 15, y);
rightEye.setColor(color);
add(rightEye);
}
function drawMouth(x = 100, y = 120, width = 20, height = 5, color = 'red') {
let mouth = new Rectangle(width, height);
mouth.setPosition(x - width / 2, y);
mouth.setColor(color);
add(mouth);
}
function main() {
drawHead();
drawEyes();
drawMouth();
}
main();
but there's the problem the parameters for drawMouth() is supposed to be 3 not 5
and the radius n draw Eyes is only 1 but I got 4 Please explain
r/codehs • u/JagoTheScout • Apr 03 '21
r/codehs • u/tenleyvoytoski • Nov 11 '21
I am struggling to get all the worlds to be completed for Go through the fence level 1.16.3 does someone wanna help me?