PCS Typing Questions

PCS Typing Questions

9th - 12th Grade

14 Qs

quiz-placeholder

Similar activities

UNIT 1.2 MEMORY

UNIT 1.2 MEMORY

10th Grade

19 Qs

After Effect Intoduction

After Effect Intoduction

10th Grade - University

15 Qs

Quizz Internet

Quizz Internet

KG - Professional Development

12 Qs

BÀI KIỂM TRA GIỮA KÌ 2 LỚP 5

BÀI KIỂM TRA GIỮA KÌ 2 LỚP 5

1st - 10th Grade

10 Qs

OOP 1 Undiksha

OOP 1 Undiksha

12th Grade - University

13 Qs

Tecnología Digital

Tecnología Digital

12th Grade

12 Qs

Empowerment Technologies Quiz 2

Empowerment Technologies Quiz 2

11th Grade

10 Qs

Chapter 3 Exploring Linux Filesystems

Chapter 3 Exploring Linux Filesystems

11th Grade - University

10 Qs

PCS Typing Questions

PCS Typing Questions

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Devan Miller

Used 9+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

14 questions

Show all answers

1.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

You are given a function which contains a non-working while loop. The function

also accepts a positive integer (x). The while loop is in an infinite loop state, which

would be unwise to run. The while loop continually decreases the value variable

by 1. Your task is to fix the code so that the loop exits and returns the value

variable when it is equal to x.

Evaluate responses using AI:

OFF

Answer explanation

Media Image

Explanation: You need to check to see if value is equal to x. If it is, then you will return the value variable.

Code (the code you write is italicized and bold, the underscores are where indentations should be):

def while_loop_finisher(x: int):

__value = -1

__while value:

____value -= 1

____if value == x:

______return value

2.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

Write a function that iterates over a tuple(tup) and returns the position of the first odd number.

Evaluate responses using AI:

OFF

Answer explanation

Media Image

Explanation: We need to go through every number in the tuple and check to see if it is an odd number. You can check to see if it is an odd number by dividing the number by two and seeing if there is a remainder of 1.

Code (the code you write is italicized and bold, underscores are where indentations should be):

def return_position_of_odd(tup: tuple):

__for x in tup:

____if x % 2 == 1:

______return tup.index(x)

3.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

Write a function that accepts two integers(a and b, where a < b) and returns the sum of all numbers between a and b (inclusive of a and b).

Evaluate responses using AI:

OFF

Answer explanation

Media Image

Explanation: We need to create a variable to store the total in. We then need to cycle through the range of numbers and add each number together inside of the variable. Then we return the total.

Code (the code you write is italicized and bold, underscores are where indentations should be):

def looping_sum(a, b):

__total = 0

__for x in range(a, b + 1):

____total += x

__return total

4.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

Write a function that accepts two integers(a, b), it should sum up all the numbers from a to b (inclusive of a and b) and then return the sum divided by 2 as float.

Evaluate responses using AI:

OFF

Answer explanation

Media Image

Explanation: We need to create a variable to store the total in. We then need to cycle through the range of numbers and add each number together inside of the variable. Then we return the total.

Code (the code you write is italicized and bold, underscores are where indentations should be):

def looping_sum(a: int, b: int):

__total = 0

__for x in range(a, b + 1):

____total += x

__return total / 2

5.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

Add the line of code needed to accumulate the total of all values of a and then print the result.

Evaluate responses using AI:

OFF

Answer explanation

Media Image

Explanation: We need to add the values of a into the total variable.

Code (the code you write is italicized and bold, underscores are where indentations should be):

total = 0

for a in range(6):

__total += a

6.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

Write a function that accepts an integer(i) which can only be 0 or 1 and returns the Boolean representation of that integer.

Evaluate responses using AI:

OFF

Answer explanation

Media Image

Explanation: We need to check to see if i is 0 or 1. If it is 1 we need to return True, and 0 would return False.

Code (the code you write is italicized and bold, underscores are where indentations should be):

def return_bool_integer(i):

__if i == 0:

____return False

__elif i == 1:

____return True

7.

OPEN ENDED QUESTION

3 mins • 1 pt

Media Image

Write a function that accepts an integer(i) which can only be 0 or 1. The function should return the inverse Boolean representation of that integer.

Evaluate responses using AI:

OFF

Answer explanation

Media Image

Explanation: We need to check to see if i is 0 or 1. If it is 1 we need to return False, and 0 would return True.

Code (the code you write is italicized and bold, underscores are where indentations should be):

def return_bool_integer(i):

__if i == 0:

____return True

__elif i == 1:

____return False

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?