
String Basics Quiz

Quiz
•
Computers
•
7th Grade
•
Hard

Mr A Sheik
Used 10+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a string variable `name` that contains your name "Alex" in Python?
`name = Alex`
`name = 'Alex'`
`string name = "Alex"`
`var name = "Alex"`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? ```python print("Hello, " + "world!") ```
Hello world!
Hello, world
Hello, world!
"Hello, " + "world!"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to use the input function to get a user's name and store it in a variable called `user_name`?
`user_name = input("What is your name?")`
`input("What is your name?") -> user_name`
`user_name <- input("What is your name?")`
`get("What is your name?", user_name)`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you concatenate the strings `str1 = "Hello"` and `str2 = "World"` to print out "Hello World"?
`print("str1 str2")`
`print(str1 + " " + str2)`
`print(str1, str2)`
`print(str1.str2)`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? ```python name = "Alice" print("Hello, name!") ```
Hello, Alice!
Hello, name!
Hello, + name + !
SyntaxError
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to print a string across multiple lines?
`print("Line 1 \nLine 2")`
`print("Line 1 // Line 2")`
`print("Line 1 \Line 2")`
`print("Line 1" + "Line 2")`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you correctly capture an input with the prompt "Enter your age:" and convert it to an integer?
`age = int(input("Enter your age:"))`
`age = input(int("Enter your age:"))`
`int age = input("Enter your age:")`
`age = input("Enter your age:").toInt()`
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Типы данных

Quiz
•
7th Grade
11 questions
Grade 7 technopython quiz1

Quiz
•
7th Grade
16 questions
Python #1 Grade #7

Quiz
•
7th Grade
10 questions
Wiz 3 Assessment Python

Quiz
•
6th - 8th Grade
12 questions
Python Quiz 8.3

Quiz
•
6th - 8th Grade
17 questions
Python

Quiz
•
6th - 10th Grade
15 questions
Hangman Game - Programming Questions

Quiz
•
7th - 11th Grade
10 questions
Python Into Quiz

Quiz
•
6th - 8th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade