For applications of where could be used, check out these other videos: Progress Loading Bar with ASCII Characters: th-cam.com/video/UrcFscXQl_4/w-d-xo.html CRLF Explained (with example in CSV file): th-cam.com/video/W149ifvprTA/w-d-xo.html
I appreciate everyone's feedback and am happy to know that this video was helpful! If you have a suggestion for a future video topic you would like me to cover, feel free to suggest it, and I can see if I can make another tutorial video.
The video i watched prior was absolutely abominable, bringing up so many arbitrary details and overwhelming concepts. Yours is so simplified, thank you, keep up the good work.🔥
# THIS THING WAS UNCLEAR TO ME FOR FREAKING 2 YEARS AND FINALLY THIS GUY CLEARED IT!!!!!!!!!!!!!!!!!!!! for _ in range(10^1000_000_000): print("THANKS A LOT YOU ANGE!") # by the way I don't care what would happen to your pc. just run the above code haha
Hi, I am gradually working through making more videos on the other escape sequences. I just released a new video on the \f form feed character here: th-cam.com/video/GYLmRJ-dVhE/w-d-xo.html . I haven't done a video on the \v vertical tab yet, but will eventually. Here's my playlist of all the escape sequence characters I've covered so far: th-cam.com/play/PLnbFWOJdmpQ2Aj6YBWmavlitSjzVFDDkW.html .
To be honest, I have not come across a practical use for using the " " when I write programs. It would be a rare situation that this may ever be required when writing code. However, I have seen that the " " can be found within program configuration files or in simple text files like CSV files as part of the Operating System's convention. Therefore, this video was more for helping people to understand what the " " means when you see it within those file types. Thanks for the question. I will go into some more detail about this in my next video. Edit: Here's the video with some more info on where you'll see carriage return ( th-cam.com/video/W149ifvprTA/w-d-xo.html )
Glad to help you learn! It is not something that I have used much at all when writing Python code. The character will more likely be something you see if you work with text-based files such as CSV or configuration files. If you want to learn more, here is another video about the CRLF character sequence (" ") which explains more info about the topic and where it is found: th-cam.com/video/W149ifvprTA/w-d-xo.html
ok so the thing is that iam I am learning js and I know who /r works in python but when I use the same thing on js which I am using chrome dev tools I am not using any code writer it just out right ignors I don't have problem with any other escape sequences if you can help it it means a lot
Unfortunately, the does not seem to work within most browsers and will get ignored. I just tested it in the Chrome dev environment and saw the same result where it got ignored. The way that any of the escape characters will be interpreted is up to the environment used. If you were to use another environment, such as Node.js, this escape character should work as expected.
Wow! Great explanation Sir. Thank you very much! Sir. I tried this on "sololearn" and it still printed Hello World even after using . Although they said might not work as expected in all Python environments, please Sir. any idea as to why this occurs?
Thanks, I'm happy that you liked the video. Yes, as you mentioned, the does not work in all Python environments. The way an editor will interpret the depends on which programming language is being used, how the compiler is designed, and additional factors. I've seen some online editors interpret correctly as a carriage return, others interpret as a newline character, and others will not interpret the (as in your case) and just print "Hello World". Since this functionality is embedded in the back-end code of the editor, I don't know of any workaround for this besides using a different editor. I use Visual Studio Code editor for my Python programs shown in the video, which I have installed on my PC. You could alternatively use the official Python online shell ( www.python.org/shell/ ) or it also works on Replit online Python editor ( replit.com/languages/python3 ).
There actually are escape codes for that called ANSI escape codes ( en.wikipedia.org/wiki/ANSI_escape_code ). You can use "\033[F" to move the cursor to the beginning of the previous line or use "\033[A" to just move the cursor straight up one line. I tested it in Python with this example: print("Hello World") print("\033[FOverlaped previous line.") There's even more you can do with the ANSI escape codes like changing the color and font styling on the terminal output too.
Hi, print("WelcomeToCoding World") Output = World it should overwritten the same word right ? in this case this output is not applicable, please help this more for above code ?
I noticed that the output can vary for different online code editors because they do not correctly interpret the " " escape character. Which code editor do you use to run Python? I like to use the Visual Studio Code editor (that's the one in the video). I also tested it with the online Python 3 console ( www.python.org/shell/ ) and it works there. When you execute this code: print("WelcomeToCoding World") It should output this: WorldmeToCoding It keeps the old text there and begins overlapping with the new.
Unfortunately, the does not work in all coding environments. Are you using an online code editor? I have noticed that some online editors will correctly interpret the as a carriage return, but others will not. I used the Visual Studio Code editor installed on my PC for the Python program shown in the video. If you want to test the functionality using an online Python editor, you could use the official Python online shell ( www.python.org/shell/ ). I'm not sure which other online editors may work.
That's a good question. I realized after making the video I should have used a better example to show this. The space would remain there, and any other characters beyond that would also remain there. It simply overwrites the characters starting from the beginning. Here is another example to show that: print("example word") Output: wordple
It is not something that I have needed to use for my own coding projects yet. But there are some situations you could use it, for example, to create a progress loading bar in a cmd terminal. The character will more likely be something you find if you work with text-based files such as CSV files. If you want to learn more about that, I made another video about the CRLF character sequence (" ") which shows some examples of where I have seen it: th-cam.com/video/W149ifvprTA/w-d-xo.html
Good question. I think it's mostly been a part of programming languages today for historical reasons. “Carriage return” (CR) used to refer to the lever on the typewriter that would move the carriage to the right side and then the type element would be back on the left side of the paper again to continue typing. This was brought into computer programming and used with the line feed (LF) character, which became CRLF ( ). CRLF is the standard text file line break used on DOS and Windows, and was also used in the past for Mac text file line breaks. I'm not familiar with Unix, but I read that traditional Unix uses Carriage Return a lot as well. I haven’t come across a practical need myself for using the “ ” escape sequence in the programs I write. But it is a useful topic to know about because you may see this character appear if working with certain files like Windows OS files. I saw it show up when I was working on the Windows Command Prompt, and so that’s where I came up with the idea for this video. Thanks for the question. I hope that helps :).
Hi, thanks for the question. So, the example I gave here wouldn't actually be a good practical use of . I just used this example of "Hello World" in the video to demonstrate how the " " escape character works. It is not something that would be commonly used when writing code; it is more of something you may come across within files such as CSV or configuration files. If you are interested, I made another video about the CRLF character sequence (" ") which goes a bit more into where it's used: th-cam.com/video/W149ifvprTA/w-d-xo.html
Good observation. It does actually work that way you specified. If you ran print("abcdef 123") the terminal would return "123def" Unfortunately, the example I used with "Hello World" didn't show that because "Hello" and "World" both have 5 letters. So "World" completely overlapped the "Hello". Next time I should choose an example that wouldn't do that. Thanks for the question.
@@sujay.b1517 Which editor are you using? I tested the print("Hello World") in an online editor, and it did just as you said by printing the words on separate lines. Perhaps something through the website causes the to be translated and executed as instead of the . I like to use the Visual Studio Code editor (that's the one in the video). And I also tried in the Python 3 Terminal window ( www.python.org/shell/ ) and it worked there.
Hi. It is not something that would be very often used when writing code. It is more of something you may notice if working within certain files such as CSV or configuration files. If you are interested, I made two other videos on the topic: In the first one here, I talk about the CRLF character sequence (" ") and go into more detail on where it's seen: th-cam.com/video/W149ifvprTA/w-d-xo.html Another video I made on this topic is an example application where you can make a terminal progress loading bar using backslash r: th-cam.com/video/UrcFscXQl_4/w-d-xo.html
Hi, thanks for the question. So, the example I gave here wouldn't actually be a good practical use of . I just used this example of "Hello World" in the video to demonstrate how the " " escape character works. It is not something that would be commonly used when writing code; it is more of something you may come across within files such as CSV or configuration files. If you are interested, I made another video about the CRLF character sequence (" ") which goes a bit more into where it's used: th-cam.com/video/W149ifvprTA/w-d-xo.html
Means Carriage Return which ''Overlap the word'' like this Ex :- if we write ( Print(''apple app'') then it will run and Display = apple. At first app will overlap apple and Display apple that's it...
For the most part, yes, it has very limited use in everyday programming. I can give you an example though where it just so happened to be useful. Recently, I had a voltage sensor that communicated through the COM port to Python, and I was printing values to the output terminal. I was printing through the loop pretty fast and didn't want it to print a new line of text every time a new value came. So that was a situation where, by using at the end of the print statement, I could overwrite the previous line of text and the loop would keep replacing it with a new voltage value in the terminal.
For applications of where
could be used, check out these other videos:
Progress Loading Bar with ASCII Characters: th-cam.com/video/UrcFscXQl_4/w-d-xo.html
CRLF Explained (with example in CSV file): th-cam.com/video/W149ifvprTA/w-d-xo.html
omg! sir, you're the only one who was able to explain this topic without all the cumbersome unecessery details.
Thanks! I'm glad you found the video helpful.
Other videos: talks about the history of carriages.
Seriously, you're pretty much the only one I have found on the internet that explains this without overcomplication the explanation. Thank you!!!
I appreciate everyone's feedback and am happy to know that this video was helpful! If you have a suggestion for a future video topic you would like me to cover, feel free to suggest it, and I can see if I can make another tutorial video.
Keep up the good work!
even chatgpt couldn't explain this, thank you so much
I wish all TH-cam videos were like this.
OMG You're a legend this is the best explanation
No unrequired details straight up to the point
Thank you soo much
The only video that actually explain what carriage return is. Thank you Sir.
thx my friend i didnt know this i was getting a headache but in IDLE dont work. now i know what is this thumbs up for u
The video i watched prior was absolutely abominable, bringing up so many arbitrary details and overwhelming concepts. Yours is so simplified, thank you, keep up the good work.🔥
others spent more than 15 min video and I was not able to understand.
You explained it in less than a minute.
Thank you!
yes I will like and subscribe, fully explained no extra 7 minutes for no reason. PERFECT to the point thank you ! ♥
Great & straight to the point explanation with a clearly understandable example! Thank you!
You explained it Perfectly. Thanks a lot.
You just made this so much easier to understand, thanks homie 🙌🏾 👍🏾
best explanation. i keep getting people tell me stories for months now and i did not get it
Amazing Video Great short explanation thanks
We all are happy and understandable with this video very clearly
straight to the point
textbook had me messed up on this one thank you for the explaination :D
This is very concise and easy to understand. Thanks.
Thanks for this explanation
thank you for this video it's very helpfull
brilliant, effective, simple. thanks
nicely and simply explained , thanks
Dude, thank you , wow
Thank you for doing this content!
Helpful video!
You have an outstanding ability to simplify things.
I wish my teachers would do the same 🤣
Awesome, thanks!
thank you sir for your explanation
It was cool...
Thanks man
Amazing and spot on! bingo Thanx..If we can't explain then we didn't understand well
Thank was an amazing explanatinon
Nice explanation
Thank you !
Helpful?? It was eye opener.
thanks
Thanks a lot 🙏
Super❤️
very helpful thx !
# THIS THING WAS UNCLEAR TO ME FOR FREAKING 2 YEARS AND FINALLY THIS GUY CLEARED IT!!!!!!!!!!!!!!!!!!!!
for _ in range(10^1000_000_000):
print("THANKS A LOT YOU ANGE!")
# by the way I don't care what would happen to your pc. just run the above code haha
I love this response 😄!
@@Electriangle ❤️
To the point... Thanks
many thanks bro
Thanks for this
thank you very much
Thank you so much!!!!!!
thank you so much sir
Nice
wow,helpful
you very much. :)
clear explanation, do you also have videos about \f form feed, and \v vertical tab ?
Hi, I am gradually working through making more videos on the other escape sequences. I just released a new video on the \f form feed character here: th-cam.com/video/GYLmRJ-dVhE/w-d-xo.html .
I haven't done a video on the \v vertical tab yet, but will eventually. Here's my playlist of all the escape sequence characters I've covered so far: th-cam.com/play/PLnbFWOJdmpQ2Aj6YBWmavlitSjzVFDDkW.html .
While I understand what it does now, I don't understand why you'd want to use this. So is there a practical example to showcase why we'd want to use
?
To be honest, I have not come across a practical use for using the "
" when I write programs. It would be a rare situation that this may ever be required when writing code. However, I have seen that the "
" can be found within program configuration files or in simple text files like CSV files as part of the Operating System's convention. Therefore, this video was more for helping people to understand what the "
" means when you see it within those file types.
Thanks for the question. I will go into some more detail about this in my next video.
Edit:
Here's the video with some more info on where you'll see carriage return ( th-cam.com/video/W149ifvprTA/w-d-xo.html )
@@Electriangle thanks for sharing! You got a new sub in me
one of the example is to print a progress bar in terminal.
@@xinchen6941 Thanks for sharing that suggestion! I hadn't thought of that. That could be a good way to use "
".
Thanks
Thank u so much sir!!! just because of u i fully understood the use of
. But sir i have a question , that where to use
in python ?
Glad to help you learn! It is not something that I have used much at all when writing Python code. The
character will more likely be something you see if you work with text-based files such as CSV or configuration files. If you want to learn more, here is another video about the CRLF character sequence ("
") which explains more info about the topic and where it is found: th-cam.com/video/W149ifvprTA/w-d-xo.html
@@Electriangle Ohk sir , thanks you so much...
ok so the thing is that iam I am learning js and I know who /r works in python but when I use the same thing on js which I am using chrome dev tools I am not using any code writer it just out right ignors
I don't have problem with any other escape sequences if you can help it it means a lot
Unfortunately, the
does not seem to work within most browsers and will get ignored. I just tested it in the Chrome dev environment and saw the same result where it got ignored. The way that any of the escape characters will be interpreted is up to the environment used. If you were to use another environment, such as Node.js, this escape character should work as expected.
thank u sir
Wow! Great explanation Sir. Thank you very much!
Sir. I tried this on "sololearn" and it still printed Hello World even after using
. Although they said
might not work as expected in all Python environments, please Sir. any idea as to why this occurs?
Thanks, I'm happy that you liked the video.
Yes, as you mentioned, the
does not work in all Python environments. The way an editor will interpret the
depends on which programming language is being used, how the compiler is designed, and additional factors. I've seen some online editors interpret
correctly as a carriage return, others interpret
as a newline character, and others will not interpret the
(as in your case) and just print "Hello World".
Since this functionality is embedded in the back-end code of the editor, I don't know of any workaround for this besides using a different editor. I use Visual Studio Code editor for my Python programs shown in the video, which I have installed on my PC. You could alternatively use the official Python online shell ( www.python.org/shell/ ) or it also works on Replit online Python editor ( replit.com/languages/python3 ).
But why isn't there an escape character to go to the previous line?
There actually are escape codes for that called ANSI escape codes ( en.wikipedia.org/wiki/ANSI_escape_code ).
You can use "\033[F" to move the cursor to the beginning of the previous line or use "\033[A" to just move the cursor straight up one line.
I tested it in Python with this example:
print("Hello World")
print("\033[FOverlaped previous line.")
There's even more you can do with the ANSI escape codes like changing the color and font styling on the terminal output too.
Thanks
Hi,
print("WelcomeToCoding
World")
Output = World
it should overwritten the same word right ? in this case this output is not applicable, please help this more for above code ?
I noticed that the output can vary for different online code editors because they do not correctly interpret the "
" escape character. Which code editor do you use to run Python? I like to use the Visual Studio Code editor (that's the one in the video). I also tested it with the online Python 3 console ( www.python.org/shell/ ) and it works there.
When you execute this code:
print("WelcomeToCoding
World")
It should output this: WorldmeToCoding
It keeps the old text there and begins overlapping with the new.
i have a problem:
and
have the same outputs but why?
Unfortunately, the
does not work in all coding environments. Are you using an online code editor? I have noticed that some online editors will correctly interpret the
as a carriage return, but others will not. I used the Visual Studio Code editor installed on my PC for the Python program shown in the video. If you want to test the functionality using an online Python editor, you could use the official Python online shell ( www.python.org/shell/ ). I'm not sure which other online editors may work.
what happens to the space after hello
That's a good question. I realized after making the video I should have used a better example to show this. The space would remain there, and any other characters beyond that would also remain there. It simply overwrites the characters starting from the beginning. Here is another example to show that:
print("example
word")
Output:
wordple
this was difficult to understand by just reading it, seeing it is an entirely different matter :)
In what real life instance would a coder use
? 🤔
It is not something that I have needed to use for my own coding projects yet. But there are some situations you could use it, for example, to create a progress loading bar in a cmd terminal. The
character will more likely be something you find if you work with text-based files such as CSV files. If you want to learn more about that, I made another video about the CRLF character sequence ("
") which shows some examples of where I have seen it: th-cam.com/video/W149ifvprTA/w-d-xo.html
what would i use
for?, what is it used for? i cant seem to find any practical uses for this command anywhere
Good question. I think it's mostly been a part of programming languages today for historical reasons. “Carriage return” (CR) used to refer to the lever on the typewriter that would move the carriage to the right side and then the type element would be back on the left side of the paper again to continue typing. This was brought into computer programming and used with the line feed (LF) character, which became CRLF (
). CRLF is the standard text file line break used on DOS and Windows, and
was also used in the past for Mac text file line breaks. I'm not familiar with Unix, but I read that traditional Unix uses Carriage Return a lot as well.
I haven’t come across a practical need myself for using the “
” escape sequence in the programs I write. But it is a useful topic to know about because you may see this character appear if working with certain files like Windows OS files. I saw it show up when I was working on the Windows Command Prompt, and so that’s where I came up with the idea for this video.
Thanks for the question. I hope that helps :).
you can use
to overwrite the same line instead of priting another - take for example a terminal progress bar
@@aonodensetsu Good suggestion. Thanks for sharing that example.
Imo comments in strings bec. /**/ Might not work
Then what the point of doing that why don't we just use print('World')
Hi, thanks for the question. So, the example I gave here wouldn't actually be a good practical use of
. I just used this example of "Hello World" in the video to demonstrate how the "
" escape character works. It is not something that would be commonly used when writing code; it is more of something you may come across within files such as CSV or configuration files. If you are interested, I made another video about the CRLF character sequence ("
") which goes a bit more into where it's used: th-cam.com/video/W149ifvprTA/w-d-xo.html
but why
print('abcdef
123')
return: '123' and not '123def'
Good observation. It does actually work that way you specified.
If you ran
print("abcdef
123")
the terminal would return
"123def"
Unfortunately, the example I used with "Hello World" didn't show that because "Hello" and "World" both have 5 letters. So "World" completely overlapped the "Hello". Next time I should choose an example that wouldn't do that. Thanks for the question.
@@Electriangle I checked again and in the windows console it actually returns: '123def', previously I used the pycharm console which returned '123'
king
My editor is printing hello in the first line and world! In the next line please help 🙏
Hmm... that sounds like something the newline character "
" would do. You are using the "
" in your code and it does that?
@@Electriangle yeh my editor does it
@@sujay.b1517 Which editor are you using? I tested the print("Hello
World") in an online editor, and it did just as you said by printing the words on separate lines. Perhaps something through the website causes the
to be translated and executed as
instead of the
. I like to use the Visual Studio Code editor (that's the one in the video). And I also tried in the Python 3 Terminal window ( www.python.org/shell/ ) and it worked there.
Kk thanks
@@ajeshgopinathan6584 I'm using windows 7 ultimate
What is the benefit of this. Why do we need this ability. N00b here, thanks.
Hi. It is not something that would be very often used when writing code. It is more of something you may notice if working within certain files such as CSV or configuration files. If you are interested, I made two other videos on the topic:
In the first one here, I talk about the CRLF character sequence ("
") and go into more detail on where it's seen: th-cam.com/video/W149ifvprTA/w-d-xo.html
Another video I made on this topic is an example application where you can make a terminal progress loading bar using backslash r: th-cam.com/video/UrcFscXQl_4/w-d-xo.html
THANK YOU I LOVE YOU SO MUCH YOU EAT
where this character is useful?
Hi, thanks for the question. So, the example I gave here wouldn't actually be a good practical use of
. I just used this example of "Hello World" in the video to demonstrate how the "
" escape character works. It is not something that would be commonly used when writing code; it is more of something you may come across within files such as CSV or configuration files. If you are interested, I made another video about the CRLF character sequence ("
") which goes a bit more into where it's used: th-cam.com/video/W149ifvprTA/w-d-xo.html
Means Carriage Return which ''Overlap the word'' like this
Ex :- if we write ( Print(''apple
app'') then it will run and Display = apple.
At first app will overlap apple and Display apple that's it...
ty for the explanation, but this literally has no use in real life programming
For the most part, yes, it has very limited use in everyday programming.
I can give you an example though where it just so happened to be useful. Recently, I had a voltage sensor that communicated through the COM port to Python, and I was printing values to the output terminal. I was printing through the loop pretty fast and didn't want it to print a new line of text every time a new value came. So that was a situation where, by using
at the end of the print statement, I could overwrite the previous line of text and the loop would keep replacing it with a new voltage value in the terminal.
@@Electriangle didn’t really think of it like that, I really appreciate how you explained it ty so much it’s such an eye opener 🙏🏻
You explained it Perfectly. Thanks a lot.
Thanks