Coventry University Logo
4061CEM - Programming and Algorithms 1
  • More About Strings
    1

More About Strings

Before you attempt this activity, it is best that you review lecture video one from week three. You can find the video and slides on the module page.

For this activity you will be using the integrated development environment recommended by the module leader. If you need to set up your development environment, it is recommended that you check out the instructions from activity four of week one.

Are You Struggling?

If you have trouble with any of the tasks or want to check your answers are correct, then please make yourself known to a member of staff.

Task 1

For this task you are required to declare a variable called name and assigned it with a value of your choice. You are then expected to print a string with the following greeting:

Hello name and welcome to 4061CEM!

To ensure you complete this task correctly, you are expected to the print the string in two different ways:

  1. using a formatted string
  2. concatenating multiple strings together.

Once you have done this, you are then expected to create a new string called greeting with the following text:

Hello and welcome to 4061CEM!

You are then tasked to do the following:

  1. Access the character m in the word welcome and print this to the screen
  2. Convert the string to lowercase using an appropriate function discussed in the lecture
  3. Find the substring 4061 in the variable greeting
  4. this line of code should print the boolean value True