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</p> Signup and view all the answers

    What do we use to access substrings in Python?

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

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

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

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

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

    What does the escape character \n represent?

    <p>Newline</p> Signup and view all the answers

    What does the string formatting operator %s do?

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

    What does the * operator do when used with strings?

    <p>Repetition</p> Signup and view all the answers

    What is the purpose of a raw string in Python?

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

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

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

    What does the escape character \t represent?

    <p>Tab</p> Signup and view all the answers

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

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

    'H' in a will give:

    <p>'True'</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</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</p> Signup and view all the answers

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

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

    How is the gradient resistance of a vehicle calculated?

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

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

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

    What is the primary objective of lubricant?

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

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

    <p>Viscosity</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</p> Signup and view all the answers

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

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

    What material is the radiator made of for efficient working?

    <p>Brass</p> Signup and view all the answers

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

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

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

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

    For which cooling method is negligible maintenance necessary?

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

    What material is used for insulation of spark plug?

    <p>Alumina</p> Signup and view all the answers

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

    <p>Feeler gauge</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</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