Operations with STRINGS you should know in PYTHON + examples

Published: 09 March 2023
on channel: Python Now
39
0

In this video, we will be covering basic operations with strings in Python, such as creation, concatenation, and formatting. In the next video, we will cover string methods and their slicing. We will begin by explaining how to create a string and different types of quotes to use. Then, we will dive into string concatenation and the built-in len() function. Finally, we will discuss string formatting and provide examples of how to use f-strings and older formatting methods. So, if you're ready, let's get started!

Basic data types in Python:
   • Basic DATA TYPES in Python + examples   - watch this!

Task 1:

Create a string that uses single quotes to enclose a sentence that contains a contraction.

Expected outcome: 'I can't believe it!'

Task 2:

Create a string that uses double quotes to enclose a sentence that contains a quote.

Expected outcome: "She said, 'Hello, world!'"

Task 3:

Create a string that uses single quotes to enclose a sentence that contains both a contraction and a quote.

Expected outcome: 'He said, "I can't believe it!"'

Task 4:
Create two string variables, one containing your first name and the other containing your last name. Concatenate the two strings and add a space in between.

Expected outcome:
The concatenated string should contain your full name.

#python #programming #strings


On this page of the site you can watch the video online Operations with STRINGS you should know in PYTHON + examples with a duration of hours minute second in good quality, which was uploaded by the user Python Now 09 March 2023, share the link with friends and acquaintances, this video has already been watched 39 times on youtube and it was liked by 0 viewers. Enjoy your viewing!