Computer Science, asked by kchvsrAnu3462, 1 year ago

What are different types of quotes in Python?

Answers

Answered by NiksDwivedi
0
Hey there!!⭐

________________________________

There are 2 types of quotes used in Python language

=> Single quotes (‘ ’)

=> Double quotes(“ ”)

We use single quotes for small symbol like strings and double quotes for natural language messages.

Eg:-

&lt;font color = blue&gt;LIGHT_MESSAGES = {&lt;br&gt;<br /><br />'English': "There are %(number_of_lights)s lights.",&lt;br&gt;<br /><br />'Pirate': "Are! Thad be %(number_of_lights)s lights."&lt;br&gt;<br /><br />}&lt;br&gt;<br /><br />def lights_message(language, number_of_lights):&lt;br&gt;<br /><br />"""Return a language - appropriate string reporting&lt;br&gt; the light count."""&lt;br&gt;<br /><br />return LIGHT_MESSAGES[language] % locals()&lt;br&gt;<br /><br />def is_pirate(message):&lt;br&gt;<br /><br />"""Return True if the given message sounds&lt;br&gt; piratical."""&lt;br&gt;<br /><br />return re search(r"(?i)(arr|avast|youth)!",&lt;br&gt; message) is not None

&lt;font color=black&gt;____________________________________

&lt;marquee&gt;&lt;font color=black&gt;HOPE IT HELPS YOU♐
Similar questions