String Methods in Python | Python Tutorial - Day #13
Summary
TLDRIn this engaging '100 Days Of Code' episode, the presenter dives into the world of Python 'String' methods, offering a fun and informative tutorial. The video explains string immutability and demonstrates various methods such as 'upper()', 'lower()', 'rstrip()', 'replace()', and 'split()', illustrating how they operate on strings to produce new ones. It also covers methods like 'capitalize()', 'center()', 'count()', 'endswith()', 'find()', 'index()', 'isalnum()', 'isalpha()', 'islower()', 'isprintable()', 'isspace()', 'istitle()', 'isupper()', 'startswith()', 'swapcase()', and 'title()'. The presenter emphasizes the practicality of these methods for tasks like blog writing and provides a hands-on approach using Replit. Additionally, the video shares insights into the presenter's recording setup, utilizing MacBook, iPhone's 'Continuity Camera', and OBS for high-quality video production.
Takeaways
- ๐บ The '100 Days Of Code' series is likened to a Netflix series, generating excitement among viewers.
- ๐ก The video focuses on 'String' methods, explaining how to manipulate strings in various ways, such as converting to uppercase or lowercase.
- ๐ The concept of 'immutability' is introduced, emphasizing that strings in Python cannot be changed in-place but can be copied and modified.
- ๐ The 'upper()', 'lower()', and 'capitalize()' methods are discussed, showing how they alter the case of string characters.
- ๐ The 'len()' function is mentioned for determining the length of a string.
- ๐ฅ The 'replace()' method is explained, demonstrating how to substitute all occurrences of a substring within a string.
- ๐ The 'split()' method is briefly introduced as a way to convert a string into a list based on spaces.
- ๐ 'rstrip()' is highlighted for its role in removing trailing characters from a string.
- ๐ The 'count()', 'endswith()', and 'find()' methods are covered, explaining how to count occurrences, check for ending characters, and find the index of a substring.
- ๐ Additional string methods like 'isalnum()', 'isalpha()', 'islower()', 'isprintable()', 'isspace()', 'istitle()', 'isupper()', 'startswith()', and 'swapcase()' are mentioned, each serving specific string validation or transformation purposes.
Q & A
What is the main topic discussed in the video?
-The main topic discussed in the video is 'String' methods in Python, including various operations that can be performed on strings such as converting to uppercase or lowercase, finding the length, and other string manipulation techniques.
Why does the video mention the concept of immutability in the context of strings?
-The concept of immutability is mentioned to explain that strings in Python cannot be changed in-place. Instead, string methods return a new string after performing the operation, which is an important aspect when working with strings in Python.
What is the purpose of the 'upper()' method in Python strings?
-The 'upper()' method is used to convert all the characters in a string to uppercase letters, creating a new string with the changes.
How does the 'lower()' method differ from the 'upper()' method?
-The 'lower()' method, unlike the 'upper()' method, converts all the characters in a string to lowercase letters, also creating a new string with the changes.
What does the 'rstrip' method do in Python strings?
-The 'rstrip' method is used to remove any trailing whitespace or specified characters from the end of a string, leaving the rest of the string unchanged.
Can you explain the 'replace' method in Python strings?
-The 'replace' method is used to replace all occurrences of a specified substring with another substring within a string, and it returns a new string with the replacements made.
What is the 'split' method used for in Python strings?
-The 'split' method is used to split a string into a list of substrings based on a specified delimiter, such as a space or any other character. It's useful for breaking down strings into more manageable pieces.
What does the 'capitalize' method do, and in which programming language is it available?
-The 'capitalize' method turns the first character of a string to uppercase and the rest to lowercase. It is available in Python, not JavaScript as mistakenly mentioned in the script.
How does the 'center' method work in Python strings?
-The 'center' method aligns the string to the center, padding it with spaces or another specified character on both sides to a given width, effectively creating a centered string.
What is the 'count' method used for in Python strings?
-The 'count' method is used to count the number of occurrences of a specified substring within a string and returns the count as an integer.
What does the 'endswith' method check in a Python string?
-The 'endswith' method checks if a string ends with a specified character or substring and returns a Boolean value (True or False) based on whether the condition is met.
What is the difference between 'find' and 'index' methods in Python strings?
-Both 'find' and 'index' methods search for the first occurrence of a specified substring within a string. The difference is that 'find' returns -1 if the substring is not found, while 'index' raises a ValueError exception if the substring is not found.
What does the 'isalnum' method check in a Python string?
-The 'isalnum' method checks if all characters in a string are alphanumeric (consisting of A-Z, a-z, or 0-9) and returns True if so, otherwise it returns False.
How does the 'isspace' method determine the content of a Python string?
-The 'isspace' method checks if a string contains only whitespace characters, such as spaces, tabs, or newlines, and returns True if it does, otherwise it returns False.
What is the purpose of the 'istitle' method in Python strings?
-The 'istitle' method checks if the first character of each word in a string is capitalized and the rest are lowercase, which is typically used for checking the formatting of titles.
Can you describe the 'startswith' method in Python strings?
-The 'startswith' method is used to check if a string starts with a specified character or substring and returns a Boolean value (True or False) based on whether the condition is met.
What does the 'swapcase' method do to a Python string?
-The 'swapcase' method swaps the case of each character in a string, converting uppercase characters to lowercase and vice versa.
What is the 'title' method used for in Python strings?
-The 'title' method is used to convert the first character of each word in a string to uppercase and the rest to lowercase, creating a title-cased version of the string.
How does the video creator record his videos, and what setup does he use?
-The video creator uses a MacBook for recording and OBS for capturing the screen. He also uses the 'Continuity Camera' feature of his iPhone to use it as a webcam, which he mounts and uses for video recording. He mentions using video effects and a desk view feature in OBS for additional visual elements.
Outlines
๐ Introduction to String Methods
The script introduces the concept of 'String' methods in programming, akin to the excitement of a Netflix series. It explains the immutability of strings, which means they cannot be changed in-place but can be copied and manipulated to create new strings. The video demonstrates various string operations such as converting to uppercase or lowercase, finding the string length, and stripping trailing characters. It emphasizes the creation of new strings through methods like 'upper()', 'lower()', and 'rstrip()', and introduces the 'replace()' method for substituting occurrences within a string.
๐ Exploring More String Methods and Replit Tutorial Access
This paragraph delves deeper into additional string methods, including 'split()', 'capitalize()', 'center()', and 'count()', explaining their functionalities and providing examples. The 'split()' method is introduced for dividing strings into lists based on spaces, while 'capitalize()' is highlighted for its utility in blog writing, ensuring the first letter of a string is uppercase. The 'center()' method is showcased for aligning strings, and 'count()' for tallying character occurrences. The script also guides viewers on how to access and utilize the Replit platform for hands-on practice, emphasizing the importance of forking the provided Replit for interactive learning.
๐ Advanced String Methods for String Manipulation
The script continues with a detailed exploration of advanced string methods, such as 'endswith()', 'find()', 'index()', 'isalnum()', 'isalpha()', 'islower()', and 'isprintable().'. It explains how 'endswith()' checks for a substring at the end of a string, while 'find()' locates the index of the first occurrence of a substring, returning -1 if not found. The 'index()' method is noted for raising an error when the substring is absent. 'isalnum()' and 'isalpha()' are introduced to check for alphanumeric and alphabetic characters, respectively, and 'islower()' to verify lowercase characters. 'isprintable()' determines if all characters in a string are printable, excluding non-visible characters like newlines.
๐ Concluding String Methods and Replit Interface Navigation
The final segment of the script covers the remaining string methods, including 'isspace()', 'istitle()', 'isupper()', 'startswith()', 'swapcase()', and 'title()'. It explains 'isspace()' returns true for strings containing only whitespace, 'istitle()' checks for properly capitalized titles, 'isupper()' for uppercase characters, and 'startswith()' for substrings at the beginning of a string. 'swapcase()' is shown to invert character cases, and 'title()' to capitalize the first letter of each word. The script concludes with a demonstration of the Replit interface, highlighting its smooth navigation and the speaker's preference for using it in the course. It also provides a brief mention of the recording setup used for the video content.
๐ฅ Behind-the-Scenes: Recording Setup and Final Thoughts
In the closing paragraph, the speaker shares insights into their video recording setup, addressing frequent inquiries from the audience. They discuss the use of a MacBook for video creation, the utilization of OBS for recording, and the innovative 'Continuity Camera' feature of Apple devices, which allows an iPhone to function as a high-quality webcam. The speaker also touches upon various video effects available for enhancing the visual appeal of the content and provides a quick tour of their desk setup. The paragraph concludes with an appreciation for the viewers and an anticipation for the next video in the series.
Mindmap
Keywords
๐กString Methods
๐กImmutability
๐กUppercase
๐กLowercase
๐กrstrip
๐กreplace
๐กsplit
๐กcapitalize
๐กcount
๐กfind
Highlights
The 100 Days Of Code series is compared to a Netflix series in terms of excitement it generates.
Introduction to 'String' methods and their importance in programming.
Explanation of how to perform operations on 'Strings', such as converting to uppercase or lowercase.
Demonstration of finding the length of a 'String' using the len() function.
Concept of immutability in 'Strings' and how it affects in-place modifications.
Illustration of using the upper() and lower() methods to change case in 'Strings'.
Introduction of the rstrip() method to remove trailing characters from a 'String'.
Explanation of the replace() method to substitute all occurrences of a substring.
Introduction to the split() method for converting 'Strings' into lists based on spaces.
Use of the capitalize() method for capitalizing the first letter of a 'String'.
Description of the center() method to align 'Strings' to the center based on a given parameter.
Explanation of the count() method to determine the frequency of characters within a 'String'.
Introduction of the endswith() function to check if a 'String' ends with a specific character or set of characters.
Explanation of the find() method to locate the index of the first occurrence of a substring.
Description of the index() method, which is similar to find() but raises an exception if the substring is not found.
Introduction of the isalnum() method to check if a 'String' consists only of alphanumeric characters.
Explanation of the isalpha() method to determine if a 'String' contains only alphabetic characters.
Introduction of the islower() method to check if all characters in a 'String' are lowercase.
Description of the isprintable() method to determine if all characters in a 'String' are printable.
Explanation of the isspace() method to check for the presence of whitespace in a 'String'.
Introduction of the istitle() method to verify if the first letter of each word in a 'String' is capitalized.
Explanation of the isupper() method, similar to islower(), but for uppercase characters.
Introduction of the startswith() method, counterpart to endswith(), to check the start of a 'String'.
Description of the swapcase() method to invert the case of characters in a 'String'.
Explanation of the title() method to convert a 'String' to title case, capitalizing the first letter of each word.
Details of the recording setup using a MacBook, iPhone, and OBS software.
Transcripts
This 100 Days Of Code series is doing just like Netflix
People are excited for this just like a TV series
It's quite fun!
In today's video we'll talk about 'String' methods
We already have studied about 'Strings'
We learned "What 'String' is" And "It is quite important 'Data Type' "
And we also had a look on the ways of creating a 'String'
Today I'll tell you how you can do operations with a 'String'
For eg. Let's suppose you want to convert a 'String' in Uppercase
Or you want to convert a 'String' in lowercase which is written in Uppercase
Or you want to find out the length of a string so how you can do that?
I'll tell you all this in this video
Lets move to the computer screen and let's get started
[
[S
[ST
[STA
[STAR
[START
[STARTI
[STARTIN
[STARTING
[STARTING
[STARTING T
[STARTING TH
[STARTING THE
[STARTING THEM
[STARTING THEME
[STARTING THEME]
So as You can see I've opened my Repl
And if you haven't accessed the play-list so make sure to do it
Bookmark it by clicking here
And save it by clicking here
Today we'll learn about some methods of 'Strings'
Let's suppose I've written here ' a = "harry" '
This the 'String' of len 5, we all know this
In the preceding video we learned, this is how we can print the len(a)
There's no big deal in that, we got 5.
But what should I do if I want to convert this string into uppercase?
The first thing I want to explain you is, "Concept of immutability"
This is I want to explain you first
'Strings' are immutable
Which means you cannot change them
But you can change them, It's not about, you can't change them at all
But you cannot change them 'in-place' Let me explain
Let's suppose I've ' a = "Harry" '
So I cannot change variable 'a' as it is
It is what it is
I can make a copy of it
So whenever I apply any method related to 'Strings'
For eg. let's suppose if I write here "print(a.upper)"
So I'll get a new 'String'
I'll get a new 'String' in which all the letters...
...Will be of uppercase
As you can see I've got "HARRY" in capital letters
It's not like the old 'String' has been changed
So this is the question they ask in interviews That's why I'm telling you
That " 'Strings' are immutable "
Let me write this here for reminding you
"Strings are immutable"
"Strings are immutable"
And obviously I'll change it to a comment
I'll make it a comment with the help of ( Ctrl + / )
So that it won't be executed
Because if this gets executed, so it'll throw an error
And I don't want it to throw error
OK! Good!
As I told you about 'Upper' method just like that there's 'Lower' method
Which converts our 'String'...
...Into lowercase
And it is very obvious "The 'lower()' method converts string to lower case."
And I also have given an example here if you want to try this out
Will this example convert this 'String-1' into lowercase?
Do you know the answer to this question?
"No! It won't"
Why?
Because it'll create a new 'String'
It won't change the existing 'String'
"Strings are immutable in Python" You can't change them
But you definitely can create a new 'String' using 'String Methods'
What do 'String Methods' do?
They operates on you existing 'String' and return a new 'String'
We learned this...
(a.upper) & (a.lower) What will (a.lower) do?
It'll convert whole 'String' "Harry" into lowercase
Great!
Now there's a method with name "rstrip" Which removes the trailing characters
Let's suppose if I had written my name like "Harry!!!!!!!"
So if I prints (a.upper) or (a.lower)
Or if I print(a) for that matter
So I'll directly get my 'String' as it is
But I want these exclamation marks to be stripped
So I'll write (a.rstrip)
What does it do?
It strips....
...Trailing characters
So I can strip exclamation marks like this
So look here.....
These marks has been striped
Does it strip leading exclamation marks?
The answer is "No"
Exclamation mark will stay on the starting
So it just strip trailing characters
So we learned this....
So I'll leave this "Harry!!!!!!!" as it is so that you can understand about 'rstrips' briefly
Now let's talk about 'replace'
What does it do?
"Replaces all occurrences of a string with another string."
Let's suppose I want to replace "harry" with "John"
So I'll write "print(a.replace("harry", "John"))
Replace "Harry" with what? And obviously I'll write this in double-quotes(" ")
Replace all the occurrences of "Harry"...
...With...
..."John"
So now if I prints it, so the 'String' will be printed as it is except "Harry" which will be replaced by "John"
As you can see here....
What if there were multiple "Harry"? Would all those also change?
Yes! As here it is written "all occurrences" so all the "Harry" will be changed to "John"
(a.replace("Harry")) all "Harry" have changed to "John"
So this is it
Now "What does 'Split' do?"
'Split' is a quite good method which converts...
...Your 'String' into a 'List'
Now we haven't studied much about 'List' yet
So I won't talk about this method for too long
But I will just show you...
If I....
....Split
Split with a 'Space'
And my 'String' must contains 'Spaces' only then the 'Split' will work
So this will be the first element of 'String' and this will be the second element of 'String'
If there's another 'space' so that will be the third element of 'String'
Which means a list of this, this & this will be created
So let me tell you how this works
If I run this so a list will be created
Which will contain "!!!Harry!!" , "!!!!!!" and then "Harry"
What is 'List'?
I'll tell you soon & very clearly
We'll also have a look on methods of 'List'
'Capitalized' method is.... In JavaScript.... Yes I'm talking about JavaScript
'Capitalized' method is not in JavaScript
'Capitalized' method is quite useful when you're writing Blogs
I remember when I was writing my Blog for "CodeWithHarry.com" in Python Django
So at that time this was quite useful to me when I had to capitalize the first character
Which means I want to display the first character as capital
For eg. let's take the heading of my Blog
Let me take realistic example so that it'll be easy for you to understand
"introduction to js" let's suppose this is my heading
Now I want to capitalize this heading
Now you'll say "just correct the spelling yourself what's the need to capitalize it?"
So what happens is... We sometime forget to write in capital
We usually write like this in a hurry
So if I've written the heading of Blog like this in a hurry
So I want this heading's first character...
...to be converted in uppercase
So I'll write "print(blogHeading.capitalize)"
And when I'll run this so the first character of my blog will be converted into capital
And my Blog will look good
So look "Introduction to js" it's first letter is in capital now
Which looks quite great
So this is how you can do it
Now look....
If I write the same thing like this....
Let's suppose if someone has made a mistake
He has write it as "tO" and this mistake is quite common when you're publishing 2-3 Blogs daily
So often this human error occurred
And let's suppose if you've written it like this....
"jS"
When you'll run this...
So 'Capitalize' will automatically correct it and look it has turned them all into lowercase
Now if you move to here and have a look on the description of Capitalize method
So you'll see "The capitalize() method turns only the first character of the string to uppercase"
It'll convert the first character into uppercase
But it'll convert all the other characters into lowercase
"The string has no effect if the first character is already uppercase"
Which is so obvious
And if your first letter is already an uppercase so what can it do?
When everything is correct so 'Capitalize' takes no effects
But this is how it works
Now there comes 'Center' method it aligns the string to the center
As per the parameter given
So I'll use the same example as here
And I'll run this...
And when it started printing "Welcome to the console" it automatically added 50 'spaces' in the starting
Now let me sow you one thing
I'll do " print(len(str1.center(50))) "
And I'll do " print(len(str1)) "
And if I run it.... So look,
Length of (str1) is 25 and length of (str1.center(50)) is 50
So what this center do is...
The length of string was 25 and it added 25 spaces in starting so that it'll be aligned to the center
So this is how 'Center' method works
And I also have written the description
Now we'll move forward and talk about "count"
What 'Count' method does is... It tells which character is occurring how many times in the string
For eg. "Harry" is occurring twice here
So if I want to count how many times "Harry" is occurring in my string
So I can print it like....
I'll write "print(a.count("Harry")) "
Tell me how many times "Harry" is occurring in string 'a'
It is occurring twice so look, it has printed 2
So this is how 'Count' method works
And then 'endswith()' function is quite useful
With this method we can find if a string is ending with given character/set of character
Let me show you... And I'll use the same example as here
I'll copy and paste this example and let me show you
The biggest advantage of using Replit is, that I've written tutorial directly here and you can practice it
So Ideally what you have to do is.... Let me tell you because this is the FAQ
You firstly have to fork my Repl
And after you fork it, you'll be able to run it
And you'll see this interface
If you access this Repl directly so you won't see this interface
You have to 'Fork' the Repl
Let me show you because it is very important
I've to this because this is very important
I'm interrupting this lecture for a sec
And I want to show you
So if you visit "replit.com/codewithharry"
And I've write it like "replit.com/@codewithharry"
If yo visit "replit.com/@codewithharry"
So for example this is my Repl
So what you've to do is, you've to click on "Fork Repl"
And when you'll click on "Fork Repl" so you'll see this interface
I'm unable to see this interface because I'm not logged in
But you'll see this interface
So basically happens is.. that a copy of my Repl is created for you
And you can edit it as you please
So I want to tell you this because it is very important
So by doing " print(str1.endswith(!!!)) " It'll tell if this string is ending with this or not
So it is ending with this... So I got 'True' as output
It'll return this me as a 'Boolean' 'Data Type'
I can use 'Boolean' 'Data Type' in (If/Else) Which I'll explain in the upcoming lecture
So this is how we can use "endswith()"
So look " We can even also check for a value in-between the string by providing start and end index positions. "
I can even tell if this string is ending with "To" between character 4 and 10
Do you understand what this means? Let me explain you
Look, if I do slicing of this string
And if I search from 4 to 10 so what will I get?
0...1...2...3...
And I'll get the text I've highlighted
I'll get "ome to"
So is this string ending with "to" ?
Yes! It is ending with "to" so I'll get "True" as output
So look if I run this...
And BTW for you information let me tell you that I can over-write a variable
In Python Programming like this
So I've got 'True' here
So this is how it works
Now let's talk about 'Find' methods
'Find' method is a quite simple method which search for the first occurrences of the given value
And it returns the index where it is present
So I'd like to tell you, if it is unable to find the string you're looking for
So it returns "-1"
You won't get it like this, so let me give you an example
So look here's a man with name "Dan" "He's name is Dan" is written here
"He is an honest man"
Now you'll say "Why have you written 'He's name is...' "
Let me tell you
It won't detect this
But it will detect this
In-fact it'll detect this because this is the first occurrence
So let me show you if we use 'Find()' method so I'll get it's index 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
I should get output " 10 "
And I'm getting output " 10 "
So it'll return me the index of the first occurrence of "is"
So if I do " print(str1.find("is")) " so it'll return me the index of first occurrence of "is"
It won't show this or this... because this is not "is" and Python don't know, because Python is not a human
Python is not a human or Snake
Python is an... interpreter or a computer
So it can compute...
It cannot detect that "He's" also means "He is "
So it'll give me the index where it'll literally find first "is"
Now the next method I want to mention is "Index" method, What is it?
Index method is basically same... in-fact it is quite similar to "Find" method
But what 'Find' does is... It return "-1" If I search for "ishh" so it'll return "-1"
Because there's no occurrence of "ishh" so it'll return "-1"
But if I copy this and change this with "index"
So an exception will be raised
And I'll get an error
So maybe if we're so sure in our program to find something so we'll use this method
But if we want our program to exit after giving an error if it's unable to find this
SO we'll use 'index' method
So 'Index' method raise an exception
"ValueError: substring not found" so this is the error it raise
And then comes the next method 'isalnum()' to find if your string is alpha numerical or not
"The isalnum() returns True only if the entire string only consists of A-Z, a-z, 0-9."
These are the alpha numeric characters
"If any other characters or punctuations are present, then it returns False.
As you can see if I run it...
"Welcome to the console"
Yes! Let me comment his out because it is throwing error
I'll comment this out because there is no occurrence of "ishh"
There is no occurrence of "ishh" so it is throwing error
So look it is an alpha numeric string so the output is 'True'
Alpha numeric means an 'String' made up of "A-Z, a-z, 0-9" these character
And then comes "isalpha" but it doesn't contains numbers unlike "isalnum"
"isalpha" will return 'True' if your 'string' consist "A-Z or a-z"
Else it'll return 'False'
This time I'll give you example with "Welcome00" if it returns 'False' or not
Now if I check for "welcome00" so it'll return 'False' but earlier it was returning 'True'
I hope I'm not explaining this very fast
So look the output is 'False'
But if I remove these double-zero(00)
So 'True' will be returned in place of 'False'
And try this on your own
If you don't so there won't be any clarity
Then comes 'islower' to check if all the characters are of lowercase or not
If yes, it'll return 'True' or else 'False'
So look, you've got this Repl and you know that you'll get this interface when you'll fork it
You can place it wherever you want like this
This navigation is so smooth
That's why I've choose Replit for this course
Because it is fun
Here appears the tutorial and here Floating video I don't think we can find better experience than this as of now
Then 'isprintable' is the next method
Try 'islower' if it is made up of lowercase so it'll return 'true'
Or if I there's any uppercase character so it'll return 'False'
I'll press ( Ctrl + Z ) and this will be returned to 'True'
As you can see
Now what is 'isprintable()'
"The isprintable() method returns 'True' if all the values within the given strings are printable"
Otherwise it returns 'False'
So it'll return 'True' if character is printable or else 'False'
I just want to show you the printable characters and all these characters are printable so it'll return 'True'
But if I add a carriage return back-slash(n)
So it'll return 'False'
Because this is not a printable character you won't be able to see back-slash(n)
So that why 'False'....
If I print...
...str1
So you won't be able to see back-slash(n)
You'll literally get the new line printed
back-slash(n) is not one of printable characters
So I hope you understood this
Now I'll tell you about 'isspace()' method
"This returns 'True' only and only if the string contains white spaces
Otherwise it returns 'False'
So if we've added white spaces using space-bar
So you'll 'True' in return
So look I've added spaces with space-bar like this
And it is returning 'True'
Even if I use 'Tab' key for spaces they'll be count as 'white spaces'
So are there spaces present?
Yes there are! So it is returning 'True'
True True
I hope you got this
Now there's a method 'istitle()' which returns 'True' only if the first letter of each word of the string is capitalized
Else it returns 'False'
So what can we do?
I remember I used this method in my Django Blog when I....
...had to capitalize all the titles of my Blog
And if there's a character which is not capital so I can find that in my dashboard
So I can do that...
If I run this... So my iPhone is also telling me that I only got 20% battery level
Please finish the video quickly
BTW many of you wants to know that how am I recording?
So I use 'continuity camera' of iPhone
Because I was getting too much messages about this, that's why I'm telling you this
It's quite great... So I'll talk about this in the end of video so that no one's time get wasted
Let me finish this title quickly
"To kill a Mocking bird"
I have to check if this falls under 'istitle' or not
So I can do that in this way
And look... "To kill a Mocking bird" "False"
Now what does 'isupper' do?
Exactly as 'islower'
Now the next method is 'startswith()' Which is exactly like 'endswith'
If your string is starting with the given character so it'll return 'True'
So look the output will be 'True' because it is starting with 'True'
Now the next method is 'swapcase()' which swaps the uppercase to lowercase and vice-versa
A very straight forward method, try to run & practice it
'swapcase()'
So look it has swap all the case
It has swapped uppercase to lower and vice-versa
Now there's a 'title()' method which converts it to a 'titlecase'
Look what's happening is... when I'll run it...
So "He's name is Dan"
Let me change this to 'His'
"His name is Dan" "And Dan is an honest man"
Now all the first characters will be tuned to uppercase just like 'I' & 'D'
So this is used usually in Blogs
I hope you've understood this quite well
And now for the ones who want to know about my recording set-up because I was getting too many questions
And for the rest ones, we'll meet in the video
This is all about coding for now
Now I'll tell about my recording set-up The one who wants to.. will listen
Rest of you can skip to next video, if any
So look, what I do is... This is my MacBook
I bought a MacBook recently
To create videos
I bought this because I was quite impress with the MacBook and I was using it in my work space and it impresses me quite a lot
So I bought MacBook because I got used to it
I often used to get confused while doing office work & personal work
So I choose to stay on MacBook
Is something wrong with Windows? No! It's great
And I recommend you to start with Windows
Well we'll leave these discussion for another video
But I record with OBS
And there's a feature in your iPhone with name 'Continuity Camera'
What it does is...
Let me show you continuity camera
If you own a MacBook and an iPhone
So when you bring you iPhone closer to your MacBook and turn on it's Bluetooth & Wi-fi
So your iPhone can automatically be used as a Web-cam
So look how good the quality is.. It is my iPhone
So I tried it.. I also have got a camera maybe you can see, it's behind me
I can use it too, and I've a variety of lenses
The quality can be improved
But again I'm pretty satisfied with iPhone's quality
So I've mounted my iPhone here
And the rest is too easy
Now there are quite impressive things in it that you have the option for video effects
So look if I choose the option 'Center Image' so look the image has moved to the center
And if I click on 'Portrait' let me show you how am I doing this
If you click here so you'll get an option for 'Video effects'
So there are 3 options let me show'em all
The first one is already in use
Now I've chosen the second one
Now if I choose 'Studio Light' so the lighting is changing
When I'll use 'Portrait' so it's get blurred
But it is good enough, I think it shouldn't blur this mic
And if I move like this so this is good and it also has blurred the stand of mic
So I know Apple will do improvement in this
But...
It's quite great, and let me turn off these effects because I use them while post processing
So I turned off these effects because I use them while post processing
Then comes the 'Desk view' in this you'll be able to see my desk
Now you're able to see my desk. Can you see it?
So this is quite good, you're able to see all the material of my desk
This desk view is visible
This is quite impressive
Can you see which angle is it using?
So let me close it for now
And that's all... I just have used this mic
Which is quite great
Normal mic was enough but I've upgraded this
I hope you're enjoying it
When the quality is good, it's fun watching videos
That's it for this video guys. Thank you so much guys for watching this video :)
And I'll see you next time
Browse More Related Video
5.0 / 5 (0 votes)