1/10
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Consider the string new_string = 'Berlin is the capital of Germany'. What is the resulting substring? new_string[-7:]
'Germany'
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
If factor = 24, which format will generate ‘**24', right aligned in its field?
factor = 24
# Format:
# '*' is the fill character
# '>' means right-align
# '4' is the total field width
output = f"{factor:*>4}"
print(output)
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
What is the result?
my_string = 'The area postal code is 99501'
print(my_string[-8:].isdigit())
print(my_string[:4].isupper())
print(my_string[:6].islower())
False
False
False
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
What is output?
my_books = 'Books 105'
index = my_books.find(", 3)
print(index)
4
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
What is the value of new_title?
title = 'Python for Beginners'
tokens = title.split(' ')
if 'Chapter 1' not in tokens:
tokens.append('Chapter 1')
new_title = ' '.join(tokens)
‘Python for Beginners Chapter 1’
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
What is the output?
my_string = 'What is your name?'
print(my_string.split('?'))
['What is your name', '']
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
Consider the list
my_list = ['www', 'python', 'org'].
What option will return ‘www.python.org'as the value to my_string.
my_string = '.'.join(my_list)
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
What defines the minimum number of character that must be inserted into the string?
The Field Width (or Total Width), in relation to the Original String Length
Padding = Field Width - Original String Length
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
What is the output?
my_poem = 'Roses are red; Violets are blue'
new_separator = '-'
new_poem = my_poem.split(';')
print(new_separator.join(new_poem))
Roses are red- Violets are blue
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
What is the output?
my_string = 'Greetings!'
print(my_string == 'greetings!')
print('tin' in my_string)
print('Hello' > my_string)
False
True
True
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz
What is the output?
new_string = 'One giant leap for mankind'
print(new_string[0:6])
One gi
# NOTE: This code was generated form Gemini AI b/c test results have not been shown for this quiz