python - ML1

python - ML1

Professional Development

9 Qs

quiz-placeholder

Similar activities

Python_R

Python_R

2nd Grade - Professional Development

8 Qs

Python Quiz

Python Quiz

Professional Development

10 Qs

Python Quiz

Python Quiz

Professional Development

10 Qs

Python 145

Python 145

4th Grade - Professional Development

11 Qs

Python

Python

7th Grade - Professional Development

13 Qs

Python Test 1

Python Test 1

Professional Development

10 Qs

Sequences

Sequences

Professional Development

10 Qs

print, input, type data, variable

print, input, type data, variable

Professional Development

11 Qs

python - ML1

python - ML1

Assessment

Quiz

Computers

Professional Development

Medium

Created by

Niranjani V

Used 1+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the "input()" function in Python?

To print output on the console

To receive user input from the console

To convert strings to integers

To define new variables

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to prompt the user for input and store it in a variable called "name"?

a) input("Enter your name: ")

b) input("name")

c) name = input(0)

d) name = input("Enter your name: ")

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the "print()" function do in Python?

a) It receives user input from the console.

b) It converts strings to integers.

c) It displays output on the console.

d) It defines new variables.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is used to assign a value to a variable in Python?

a) store

b) var

c) val

d) =

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet?

message = "Hello, World!"

print(message[7:])

a) "World!"

b) "Hello"

c) "Hello, "

d) "World"

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the type of the variable "num" after executing the following code?

num = input("Enter a number: ")

a) integer

b) string

c) float

d) boolean

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

x = 10

y = "5"

print(x + int(y))

a) 15

b) "105"

c) "15"

d) Error

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to concatenate two strings in Python?

a) str1 + str2

b) str1 .concat(str2)

c) concat(str1, str2)

d) join(str1, str2)

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you convert a string to all uppercase letters in Python?

a) str.uppercase()

b) str.to_upper()

c) str.upper()

d) str.case_upper()