Examplary
Start for free
Oak ComputingTest · Computing

String manipulation

The starter and exit quiz of the lesson “String manipulation”, from the unit “Programming: strings and lists” (Year 10 Computing) by Oak National Academy.

Free to use. Edit it, share it and hand it out to your students.

Oak National Academy

12 questions

  1. What is a substring?
  2. What will the following Python code output?word = "asparagus"first_three = word[0:3]print("sp" in first_three)
  3. What is ASCII?
  4. What does the following code do?char = "G"print(ord(char))
  5. Which Python function converts an ASCII value back into a character?
  6. What does the following Python program do?char = input("Enter a character: ")print(chr(ord(char) + 1))
  7. What is the correct way to join the strings "blue" and "berry" into one word?
  8. What must you include in your program to use the random library?
  9. String ___ is joining two or more strings together.
  10. What will be printed by the following code?word = "Pinecone"print(word.upper())
  11. Which of the following correctly selects a random letter from the word "elephant"?
  12. The random module generates ...

License: OGL

String manipulation · Examplary