Docsity

CodeHS Introduction to Programming (Python) Exam Questions and Answers, Exams of Programming Languages

Partial preview of the text

Download CodeHS Introduction to Programming (Python) Exam Questions and Answers and more Exams Programming Languages in PDF only on Docsity!

CODEHS:INTRODUCTION TO

PROGRAMMING (PYTHON) EXAM WITH

CORRECT ACTUAL QUESTIONS AND

CORRECTLY WELL DEFINED ANSWERS

LATEST ALREADY GRADED A+ 2025 – 2026

1.18.4: Super Cleanup Karel - ANSWERS-for i in range(30): while front_is_clear(): if balls_present(): take_ball() move() else: move() while not_facing_north(): turn_left() if balls_present(): take_ball() if front_is_clear(): move()

if right_is_blocked(): turn_left() if left_is_blocked(): turn_right() 1.18.5: Double Tennis Balls - ANSWERS-move() while balls_present(): take_ball() move() put_ball() put_ball() turn_around() move() turn_around() move() turn_around() while balls_present(): take_ball() move() put_ball() turn_around()

1.2.5: Short Stack - ANSWERS-move() put_ball() put_ball() move() 1.3.2 More Basic Karel Quiz Question: 1 What is a street in a Karel world? A row A column A single point Karel's position 1.2.2 Quiz: Karel Commands Question: 1 Which of these is a valid Karel command? move

MOVE

move() move(1) Question: 2 Which one of these is NOT a command that Karel knows? Turn Left Turn Right Move Forward Put Down a Ball - ANSWERS-move() Turn Right Question: 2 What is an avenue in a Karel world? A row A column A single point

runs, which direction is Karel facing now? North South East West - ANSWERS-A row A column Street 2 and Avenue 6 South 1.3.4: Make a Tower - ANSWERS-move() turn_left() put_ball() move() put_ball() move() put_ball() move()

turn_left() turn_left() turn_left() 1.3.5: Pyramid of Karel - ANSWERS-put_ball() move() put_ball() move() turn_left() put_ball() move() put_ball() turn_left() move() put_ball() turn_left() turn_left() move() turn_left() move() put_ball()

Functions 1.4.4: Fireman Karel - ANSWERS-def turn_right(): turn_left() turn_left() turn_left() turn_right() move() move() move() turn_left() 1.4.5: Slide Karel - ANSWERS-def turn_right(): turn_left() turn_left() turn_left() put_ball() move() turn_right() move()

put_ball() move() turn_left() move() put_ball() 1.5.2 Functions in Karel Quiz Question: 1 Which function will teach Karel how to spin in a circle one time? A def spin(): turn_right() B def spin(): turn_left() turn_left() turn_left() turn_left() C def spin():

move() make_pancakes() move() move() make_pancakes() move() 1.5.5: Backflip - ANSWERS-def backflip(): turn_left() turn_left() turn_left() turn_left() move() move() move() move() backflip() 1.5.6: Digging Karel - ANSWERS-def turn_right(): turn_left() turn_left()

turn_left() def turn_around(): turn_left() turn_left() def bury_ball(): turn_right() move() move() move() put_ball() turn_around() move() move() move() turn_right() move() move() bury_ball() move() move() move()

Top down design is a way of designing your program by starting with the biggest problem and breaking it down into smaller and smaller pieces that are easier to solve. Top down design is a way that you can create designs on a computer to put on a web page Top down design is a way of designing your programs starting with the individual commands first Top down design is a way to use loops and classes to decompose the problem - ANSWERS-All of the above Top down design is a way of designing your program by starting with the biggest problem and breaking it down into smaller and smaller pieces that are easier to solve. 1.6.4: The Two Towers - ANSWERS-def stack(): put_ball() turn_left() move() put_ball() move() put_ball() turn_twice()

move() move() turn_left() def turn_twice(): turn_left() turn_left() def turn_right(): turn_left() turn_left() turn_left() move() stack() move() move() turn_left() put_ball() move() put_ball() move() put_ball() move()

turn_twice() move() move() turn_left() def turn_twice(): turn_left() turn_left() def turn_right(): turn_left() turn_left() turn_left() move()

make a stack of 3 balls

stack() move() move() turn_left()

starting a stack of 3 balls

put_ball() move() put_ball()

move() put_ball() move() turn_right() 1.8.2 Abstraction Quiz Question: 1 Each of the following answer choices describes a basketball game. Which answer choice describes the game with the lowest level of abstraction? The Warriors won by 10 points. The Warriors had an early lead, but were down by 4 at halftime. They tied it up in the 4th quarter and the game went into overtime. They won by 10 points in overtime. First, Steph Curry jumped in the air and grabbed the ball. Then he dribbled it three times and passed it to Klay Thompson... First, Steph Curry flexed his left and right quad muscles at the exact same time, then he flexed each muscle in his fingers...