PRG1 - Day 4 starter

PRG1 - Day 4 starter

University

8 Qs

quiz-placeholder

Similar activities

1-基本数据类型

1-基本数据类型

University

10 Qs

INSY55-SystemAnalysisandDesign_Pre-Assessment

INSY55-SystemAnalysisandDesign_Pre-Assessment

University

10 Qs

CSSE Quiz Day2

CSSE Quiz Day2

University

12 Qs

Công nghệ thông tin

Công nghệ thông tin

University

10 Qs

kuis cepat sejarah perkembangan komputer

kuis cepat sejarah perkembangan komputer

University

10 Qs

Webinar Quiz

Webinar Quiz

University

13 Qs

Recursion Practice, Recursion Practice, Recursion Practice...

Recursion Practice, Recursion Practice, Recursion Practice...

10th Grade - University

10 Qs

JavaScript Quiz

JavaScript Quiz

University

12 Qs

PRG1 - Day 4 starter

PRG1 - Day 4 starter

Assessment

Quiz

Computers

University

Easy

Created by

Steve Rich

Used 5+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is output?

// JavaScript

console.log(examResults.steve[0]);

# Python

print(exam_results['steve'][0])

[ 99, 98, 95 ]

99

[ ]

Undefined / Error

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

JS: What does trim() do?
Python: What does .strip() do?

It extracts a substring from a string.


It removes all characters from a string.


It converts a string to title case.

It trims whitespace from the beginning and end of a string.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How can you convert a string to lowercase?

Python: .to_lower()

JS: toLower()

Py: .make_lower()

JS: makeLower()

Py: .convert_lower()

JS: convertLower()

Py: .lower()

JS: toLowerCase()

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which method can be used to split a string into an array of substrings based on a specified delimiter?

.slice()

.concat()

.join()

.split()

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is output?

Py: print(98 in exam_results["violet"])


JS: console.log(examResults.violet.includes(98));

True

False

Error

98

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python & JS, can a variable name (also known as an 'identifier') start with a number? e.g. 5rings

Yes

No

Sometimes

Only in certain versions

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does this code do?

JS: bigMac.Fat = 30;
Py: big_mac['Fat'] = 30

Sets the fat content of a Big Mac to 30.

Deletes the fat content of a Big Mac.

The code retrieves the fat content of a Big Mac.

Calculates the calories of a Big Mac.

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the result?

// JavaScript

bigMac['Calories'] = 300;

# Python

big_mac['Calories'] = 300

The calories for a Big Mac is updated to 300

Nothing. It already exists.

A second Calories option is added.

An error message is displayed.