ABREDES - Devasc Python

ABREDES - Devasc Python

Professional Development

14 Qs

quiz-placeholder

Similar activities

04 JavaScript Einführung

04 JavaScript Einführung

Professional Development

10 Qs

Technical Training

Technical Training

Professional Development

15 Qs

KEEP MOVING FOWARD

KEEP MOVING FOWARD

Professional Development

10 Qs

Quiz Mobilku BCMH Week 2 (12/12/20)

Quiz Mobilku BCMH Week 2 (12/12/20)

Professional Development

15 Qs

BÀI TẬP_KIỂU DỮ LIỆU VÀ KHAI BÁO BIẾN

BÀI TẬP_KIỂU DỮ LIỆU VÀ KHAI BÁO BIẾN

Professional Development

10 Qs

EXAM SES TAB S8 JAN 2022

EXAM SES TAB S8 JAN 2022

Professional Development

10 Qs

CSNP 04103 C++ Midterm preparation

CSNP 04103 C++ Midterm preparation

University - Professional Development

11 Qs

MY_GameON: 19 May > Learn-Olympics (QF)

MY_GameON: 19 May > Learn-Olympics (QF)

Professional Development

10 Qs

ABREDES - Devasc Python

ABREDES - Devasc Python

Assessment

Quiz

Professional Development, Computers

Professional Development

Medium

Created by

Quizzes ABRedes

Used 7+ 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.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

What command is used to install Python modules from PyPI? (Choose two.)

pip load packagename

pip install packagename

python3 -m pip install packagename

python3 -t pip install packagename

Answer explanation

PyPI is a repository that holds thousands of Python modules that you can import. To install it, you can use python3 -m (module) pip install and the name of the package you want. You can also directly install it with the pip command.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the standard for indention in Python?

One space for each block of code

Four spaces for each block of code

One tab for each block of code

One tab and one space per block of code

Answer explanation

PEP 8 is the style guide for Python syntax, and it specifies four spaces for each block of code. Tabs will work, and your editor may actually convert them automatically for you, but it is a good practice to follow the standard.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How are comments in Python denoted?

// on each line you want to make a comment

# or '" quotation marks encompassing multiline comments

/* comment */

@$ comment %@

Answer explanation

Comments are specified by the # or three single quotes '''. The benefit of using the single quotes is that you can write multiline text.

4.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of the following are mutable data types? (Choose two.)

Lists

Dictionary

Integers

Tuples

Answer explanation

Lists and dictionaries are both mutable, or changeable, data types. Integers and tuples must be replaced and can’t be edited, which makes them immutable.

5.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of the following would create a dictionary?

a= (" name","chris","age",45)

a= dict()

a= {" name":"chris", "age": 45}

a= [name, chris, age, 45]

Answer explanation

You can create an empty dictionary object by assigning the function dict() to a Python object (in this example, a). You can insert dictionary values as well by using braces, {}, and key:value pairs that you assign to an object.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What data type does the input() function create when assigned to a variable?

List

Raw

String

An auto typed one

Answer explanation

The input() function by default creates a string data type.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which print statement is valid for Python 3?

print 'hello world'

print("hello world')

print(hello, world)

print("'hello world'")

Answer explanation

The only one that is valid as is would be print('''hello world'''). print(hello, world) would be valid only if there were two variables named hello and world; otherwise, it would produce an error. Since you don’t know in this case whether these variables exist, print('''hello world''') is the correct answer.

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?