Python Strings Quiz
31 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which type is amongst the most popular in Python?

  • Tuple
  • Set
  • List
  • String (correct)

How can strings be created in Python?

  • By using braces
  • By using angle brackets
  • By enclosing characters in quotes (correct)
  • By using parentheses

What type of quotes does Python treat the same for creating strings?

  • Double quotes and triple quotes
  • Double quotes and parentheses
  • Single quotes and double quotes (correct)
  • Single quotes and triple quotes

How does Python handle a character type?

<p>It treats it as a string of length one (B)</p> Signup and view all the answers

What do we use to access substrings in Python?

<p>Square brackets (A)</p> Signup and view all the answers

How can an existing string be 'updated' in Python?

<p>By reassigning a variable to another string (C)</p> Signup and view all the answers

What does the following code print: print 'Updated String :- ', var1[:6] + 'Python'

<p>Updated String :- Hello Python (D)</p> Signup and view all the answers

What does the escape character \n represent?

<p>Newline (B)</p> Signup and view all the answers

What does the string formatting operator %s do?

<p>string conversion via str prior to formatting (A)</p> Signup and view all the answers

What does the * operator do when used with strings?

<p>Repetition (B)</p> Signup and view all the answers

What is the purpose of a raw string in Python?

<p>Suppresses actual meaning of Escape characters (C)</p> Signup and view all the answers

What is the result of the expression a[1:4] if a = 'Hello'?

<p>'ell' (D)</p> Signup and view all the answers

What does the escape character \t represent?

<p>Tab (C)</p> Signup and view all the answers

What is the result of the expression 'Hello' * 2?

<p>'HelloHello' (A)</p> Signup and view all the answers

'H' in a will give:

<p>'True' (A)</p> Signup and view all the answers

'Zara' and 21 are inserted into the string using which format symbol and conversion?

<p>%s and %d (A)</p> Signup and view all the answers

What is the propulsion type called when the power is produced in the vehicle itself?

<p>Self propulsion (A)</p> Signup and view all the answers

What is the sum of tractive effort developed by a vehicle?

<p>Gradient resistance and rolling resistance (A)</p> Signup and view all the answers

How is the gradient resistance of a vehicle calculated?

<p>$w \sin \theta$ (C)</p> Signup and view all the answers

To what is the air resistance of automobile body and chassis proportional?

<p>Square of speed (C)</p> Signup and view all the answers

What is the primary objective of lubricant?

<p>Reduce wear (A)</p> Signup and view all the answers

Which property is the most important to be considered for lubricant?

<p>Viscosity (A)</p> Signup and view all the answers

What is the purpose of keeping the choke closed when the engine is running?

<p>To maintain a cold engine (C)</p> Signup and view all the answers

What is the ideal temperature needed for perfect combustion of diesel fuel?

<p>8000°C (B)</p> Signup and view all the answers

What material is the radiator made of for efficient working?

<p>Brass (B)</p> Signup and view all the answers

What is the function of the thermostat in the cooling system?

<p>Maintain temperature of cooling water (D)</p> Signup and view all the answers

Which type of radiator is fitted to high-speed vehicles?

<p>Honeycomb type (A)</p> Signup and view all the answers

For which cooling method is negligible maintenance necessary?

<p>Air-cooling (B)</p> Signup and view all the answers

What material is used for insulation of spark plug?

<p>Alumina (A)</p> Signup and view all the answers

Which instrument is used to check the gap of the contact breaker?

<p>Feeler gauge (B)</p> Signup and view all the answers

What voltage is needed at the spark plug gap to generate spark in the combustion chamber?

<p>12,000 V (C)</p> Signup and view all the answers

More Like This

Python Programming Fundamentals Quiz
10 questions
Python Data Types Fundamentals
2 questions

Python Data Types Fundamentals

SupportedSydneyOperaHouse2347 avatar
SupportedSydneyOperaHouse2347
Python 10-سىنپ ماتېرىياللىرى
8 questions
Use Quizgecko on...
Browser
Browser