RegEx in Python
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Veronika Gacia
Used 9+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
test = "Anna und Hanna essen Kekse."
ergebnis = re.search(r"[K].+?\b", test)
print(ergebnis)
Was wird ausgegeben?
Kekse
<re.Match object; span=(21, 26), match='Kekse'>
<object; match='Kekse'>
<span=(21, 26), match='Kekse'>
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
test = "Anna und Hanna essen Kekse und danach Knödel."
ergebnis = re.findall(r"[K].+?\b", test)
print(ergebnis)
[Kekse, Knödel]
'Kekse', 'Knödel'
Kekse, Knödel
['Kekse', 'Knödel']
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
import re
string = "Dies, das, Ananas."
ergebnis = re.findall(r"\b[Dd]?\w+?\b", string)
print(ergebnis)
Was wird ausgegeben?
['Dies', 'das', 'Ananas']
['Dies', 'das']
['Ananas']
'Dies', 'das', 'Ananas'
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
string = '"Ich liebe Plätzchen!" "Magst du auch Kuchen?"'
Wie könnte ein regulärer Ausdruck aussehen, der den Teilstring "Ich liebe Plätzchen!" in der Variable string findet?
r"\"\w*!\""
r"\".?!\""
r"".*!""
r"\".*!\""
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
prozente = "Nach Weihnachten ist alles um mindestens 10% reduziert: Ob 25%, 30% oder sogar auch 80% - hier kann jeder Schnäppchen machen!"
Welche Codezeile findet mit Hilfe des passenden regulären Ausdrucks alle Prozentwerte im Text?
print(re.findall(r"\d%",prozente))
print(re.findall(r"\W\W%",prozente))
print(re.findall(r"[0-9][0-9]%",prozente))
print(re.findall(r"[0-100]%",prozente))
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
text = "Wie bitte? Das meinen sie doch wohl nicht ernst, wie stellen die sich das vor?"
ergebnis = re.findall(r"[^ws]ie", text)
Was steckt in der Variable 'ergebnis'?
['sie', 'wie']
['Wie', 'die']
['die']
['Wie']
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Mit welchem regulären Ausdruck kann nach Satzanfängen gesucht werden?
r"[.!?]\s[A-Z]"
r"[.!?].+[A-Z]"
r"[.!?]?[A-Z]"
r"[.!?].*[A-Z]"
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Cybercrime
Quiz
•
University
15 questions
Circuitos
Quiz
•
University
10 questions
Khoi 3
Quiz
•
1st Grade - University
12 questions
Hálózat
Quiz
•
University
10 questions
321 - Quiz07
Quiz
•
University
11 questions
Java Programming
Quiz
•
University
13 questions
Historia de la internet
Quiz
•
University
10 questions
DBMS Quiz1
Quiz
•
University - Professi...
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
9 questions
Principles of the United States Constitution
Interactive video
•
University
18 questions
Realidades 2 2A reflexivos
Quiz
•
7th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
25 questions
Integer Operations
Quiz
•
KG - University
7 questions
What Is Narrative Writing?
Interactive video
•
4th Grade - University
20 questions
SER vs ESTAR
Quiz
•
7th Grade - University
