Quiz
a = 'Amazing'Which expressions will let you print the second character 'm' of this String
a = 'Amazing'Which expression will get you the characters from position 0 to index of 'z', including 'z'
<question>
<p>A string is assigned to a variable <pre><code>a = 'Amazing'</code></pre>You wrote an expression to find if the given string has a substring 'zing' <pre><code>a.find('zing')</code></pre> This expression returns the - </p>
<answer correct>index number 3 where it found the substring zing</answer>
<answer >index number 4 where it found the substring zing</answer>
<answer >returns the substring zing</answer>
<answer>None of the above</answer>
</question>
<question>
<p>A string is assigned to a variable <pre><code>a = 'amazing'</code></pre>You wrote an expression to capitalize this string <pre><code>a.capitalize()
print(a) This will print -
</question>
<question>
<p>A string is assigned to a variable <pre><code>a = 'amazing'</code></pre>You wrote an expression to find its length <pre><code>print(len(a))</code></pre> This will print - </p>
<answer correct>7</answer>
<answer>6</answer>
<answer>1</answer>
</question>
<question>
<p> What is the result of evaluating this expression <pre><code>'amazing'.count('a', 1)</code></pre></p>
<answer correct>1</answer>
<answer>2</answer>
<answer>0</answer>
<explanation>Since the start position 1 is given, it counts the number of 'a' from index position 1 </explanation>
</question>
<question>
<p> What is the result of evaluating this expression <pre><code>'amazing'.count('a', 0, 2)</code></pre></p>
<answer correct>1</answer>
<answer>2</answer>
<answer>0</answer>
<explanation>Since the start position 0 and the end position 2 is given, it counts the number of 'a' from index position 1 to index position 2, excluding 2 </explanation>
</question>
<question>
<p> Study the code below <pre><code>pi = 3.141592653589793
b = f'{pi:.3f}' print(b) What is the output of the print statement?
</question>
<question>
<p> Study the code below <pre><code>pi = 3.141592653589793
b = f'{pi:.3f}' print(type(b)) What is the data type of 'b'?
</question>
<question>
<p> Study the code below <pre><code>t1 = (5, 8)
t2 = (10, 15) d = f'X: {t1[0]}; Y: {t2[1]}' print(d) What is the output?
</question>
<question>
<p> What is output of the given expression?<pre><code>a = 3.14159
f'{a:.0f}'
</question>
<question>
<p> What is output of the given expression? <pre><code>val1 = 'B'
val2 = 10 f'{val2}{val1}'
</question>
##Exercise