What Is a String? (Exercise)
00:00 Here is your first exercise. What is a string? Very philosophical question, but we’re going to go about it a little more practically. Your task is going to be to print four individual strings that fulfill certain conditions.
00:14 The first one is that there should be double quotation marks inside the string. The second one should have an apostrophe inside the string. The third one should have multiple lines with whitespace preserved, and the fourth one should be coded on multiple lines, but then it gets printed only on a single line.
00:30 These are different ways of constructing strings, and it’s just a way to remind yourself how you can create strings that fulfill the certain conditions.
00:38 Go ahead, do this now, and once you’re done with your solution, hop over to the next lesson, where I will solve the four tasks as well, and then you can compare with my solution.
Become a Member to join the conversation.