#4 Python Tutorial for Beginners | Variables in Python
ฝัง
- เผยแพร่เมื่อ 5 ก.พ. 2025
- Check out our courses:
Java Full Stack and Spring AI - go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
DevOps with AWS: From Basics to Mastery : go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com...
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
Spring: go.telusko.com...
Java:- go.telusko.com...
Java Spring:- go.telusko.com...
Java For Programmers:- go.telusko.com...
Python : go.telusko.com...
Git : go.telusko.com...
Docker : go.telusko.com...
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusk...
Instagram : / navinreddyofficial
Linkedin : / navinreddy20
TELUSKO Android App : bit.ly/TeluskoApp
In this lecture we are discussing variable in python:
Variable: It is a container where we can put our value
e.g
x=2 #here x is variable and 2 is value
x+3
5
y=3
Note:If I want to use output of previous operation so we use underscore (_)
_+y
8 # previous output 5 and y is 3
Use String as a variable:
-- Strings in python are surrounded by either single quotation marks, or double quotation marks.
-- e.g "shiva" ,'shiva'
Assign String to a Variable:
-- Assigning a string to a variable is done with the variable name followed by an equal sign and the string:
name='shiva'
name
shiva
Slicing String:
we can return a range of characters by using the slice syntax.
Specify the start index and the end index, separated by a colon, to return a part of the string.
-- Get the characters from position 2 to position 5 (not included):
name='youtube'
name[2:5]
'utu'
Slice From the Start:
name[:5] #from starting to index 5 (exclude)
'youtu'
Slice To the End:
name[2:] #from 2nd index to end
'utube'
Negative Indexing:
0 1 2 3 4 5 6 #positive indexing
y o u t u b e
-7 -6 -5 -4 -3 -2 -1 #Negative indexing
name[-1]
'e'
name[:-1]
'youtub'
name[:]
'youtube'
name [:0]
''
name[-5:-2]
'utu'
Concatenate String:
name+ ' telusko'
'youtube telusko'
Github :- github.com/nav...
Java:- bit.ly/JavaUde...
Spring:- bit.ly/SpringU...
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com - วิทยาศาสตร์และเทคโนโลยี
Navin Reddy has 11 characters (including space between two words)
Can we count these characters without space?
Correct😀
no
How would you write the string to only count letters?
@@danyjovial1051 no it is not possible
Making such a effort without expecting anything and explaining with lots of clarity is really awesome,and huge respect to you
100th like is from me
Yes
Yaaa
True...💯💯❤️
really loving sir... god bless you
First time ever in my life listening carefully with full interest on one pgming language lecture...the same lecture on these topics by my faculty made me sleep so hard😝...great effort and concept is easily understandable...Thanks a lot sir.
So True!!!!!! LOL
Is it helpful comparing to other videos?
You're a GOD'S GIFT to us!! ♥️ Couldn't imagine to learn something with such fun, thank you Navin 💯
Wanted to learn Python from last 2 years but unable to continue interest and now you're here 😍
Loving the sessions
Output -
Telusko
Rocks
Since at start of the string you've mentioned r which stands for raw string, it means that the string will be printed as it is(in a raw state) no special meanings will be considered.
I never thought python so easy programming language by listening this awesome lecture...
Thank you so much Navin Reddy Sir...
1. print(r '
') means print as it is.
2. _ (underscore represents) result of last.
3. name[-1] last digit of array
4. name[-2] last but digit of array
5. name[0:2] if name = ajit it will print 'aj'
6. name[0:3] if name = ajit it will print 'aji'
7. len(name) it will print 4(length of the ajit)
8. if a = ajit a[1:3] - when you print this it will give "ji" not "jit" because indexing excludes the last letter.
good going , summary of the session
yes, but let them know that when indexing the last letter gets excluded. ex: a = ajit a[1:3] - when you print this it will give ji not jit because indexing excludes the last letter.
@@Munchkie ok Got it.
Thanks for the nots ❤️
I am an idiot. You already said this.
Never knew python is enjoyable this way. Thanks for it.
hope it continues
😍
i swear down
Really osm
It all depends on the teacher.... Everything is enjoyable
Just started this because I was frustated with Java courses. This is SOOOOOOOO much simpler! thank you sir!!
Print (100*respect)
Love the way you tech nivin sir..
Learning during corona holiday 😁
NameError: name 'respect' is not defined
bro watch more carefully :P
@@rokkababa8448 shitxD
@@rokkababa8448 print(r'100 * "respect"')
lol me too
keep going but 100 * 'respect'
I have been studying python for about 3-4 months now. Your enthusiasm is contagious. I had so much fun learning this😁
most energetic teacher on TH-cam.. tbh one of the best teachers I have ever seen in my life.
name='navin reddy'
respect='nosire'
print('thank you ' +name+' '+respect[2:5])
SyntexError: invalid charactor in identifier.
print('thank you '+name+' '+respect[2:5])
thank you navin reddy sir
i m not getting any error.
name='Navin Reddy'
Honour='Nosire'
print ("Thank you" + name + Honour [2:5])
it was simple to getting output
try this one
name =' navin reddy'
respect = ' nisire'
print('hello'+name+respect)
Everytime he tells us something new he pretends like he never knew it would come out this way... and that makes him cool !
exactly, thats cool.
@@rekhabansal9065 😁👍
Thanks Navin for your wonderful series. Your way of explaining thse concepts is exemplary. Easy and to-the-point.
I used to teach C lanuage 20 years ago, and I like the way you are doing this very much.
Thanks for taking the time to simplify this. Bless you
First time I heard somebody explaining variable in such simple way.
Regards
Your explanations are very easy to understand and anyone who is struggling to learn programming before can learn easily just by watching your sessions
Love python from a such a talented and interactive teacher sir
Output for quiz question:
Telusko
Rocks
Thank you sir for clear explanation,, after executing codes you are saying wow its working☺,that's good sir. You are changing the way of learning, keep going on navin sir. I am suggesting all my friend's to watch your channel
This answer is almost true. r before the string implies that the string has to be printed as raw string. So the correct answer would be. Telusko Rocks
I am really enjoying Python series and
also like the new video format
I have been following your tutorials from a very long time when you had 50-60k subscribers. Your content was good then and now of course.
But the best part is you have also evolved as a creator in terms of your appearance, video quality & viewer's engagement.
Thank you for educating us.
Keep doing! Keep motivating (Y)
What a energy, i got some interest to learn python now 😊😊
Thanks Sir...I always scared from coding despite being a computer science graduate. But your videos are awesome and very easy to comprehend. Please keep up the good work that you are doing. Thanks!
Sir the way of your teaching really inspired me to learn more
You are amazing.... Ur the person making efforts without expecting anything 😊😊
previously i was not in the mood to learn python, but your videos made me do so
True
feelings = " LOVE"
expression = " Great"
print(" Its " , {Feelings} , " to watch your tutorials & its ", {expression})
print(" Its " , feelings , " to watch your tutorials & its ", expression)
this is correct
@@byspandanan7410 you both are wrong.
bro use .format while u use {}
@@lokeshmadiga6215 what is correct, can you please help me printing the exact syntax?
@@mwendeevande3743 i think spandana nandigum is right.
much better than code with harry playlists . He is atleast starting this from start not like harry u have started his series from quiet a high level
I am an Architect (civil), have absolutely zero programming knowledge or background, and just wanted to make the lockdown break useful.You sir, are an amazing teacher and have actually made python so much fun.Thank you for the effort.Keep up the good work.
Does Learning this language make any difference till now for you???
Navin thank you, I am new to this and I am enjoying learning python. I like the way you teach. Your explanations are thorough and you keep it very simple. I am glad I came across your channel, and I did subscribe.
The enthusiasm with which u r teaching is great and your teaching skills is fabulous .
Seriously lucky to have a teacher like you
Very enjoyable teacher, teaching and class
'Telusko
Rocks' i got this output for you last quiz in the video. and i love your teaching method the way you are explaining it s really amazing for an individual who does not have any coding background.
Bro the commas u entered in the first and last so there is an error
You are great teaching sir!!❤☺️
I understood very well
I like python because of you!!😊
Sir, In the quiz the output is
'Telusko
Rocks'
Bro i think
Telusko
Rocks
Because
indicates next line
@@darshannt4057 as r is mentioned it will skip the special meaning of
so the above ans is right
@@sayleesurve2708 yup
yes correct answer 'Teisuko
Rocks'
This is amazing, I'm really enjoying tutorials.I am a beginner of programming, with these videos i'm sure i will become a programmer
i just love him. such a tutor needs to be in colleges
myname= 'Navin Reddy'
len(myname)
11
here what i observed is even the space between Navin and Reddy is counted right so it makes 11 in total .
Thank you so much Sir
Hey naruto I am Itachi... Amaterasu
@@codinghub3759 haha
I think so
Space is counted in len string??
@@Raghav-rai yupp.
I like his INTROs in which he's like "hello there ALIENS!!!!"
Right 😁😁😁😁
But why are we aliens??just because we are learning Python!! 😅
@@dynamisarian6576 Plot twist: Navin Sir is from another planet.
@@nitinchauhan365 woww..it could be👌🏻😁
Alien means far from... Means either another state, country or planet. What ever it is.
Alien means foreigner
@@mveera5441 very good
for the first time I am having fun with learning programming. thank you for making this much effort for free, you have my respect.
Answer: Telusko
Rocks
Really enjoyed😃
stands for new line !
Rocks will come in a new line
@@iamjoker101 what is that r means? because of r o/p is coming as it is
@@jahnavimiriyala1640 it is a raw line
Using r and
is like using a blanket with a fan...
You have both things and you use one to counter the other...
Telusko
Rocks (This is the answer of quiz)
This is an awesome tutorial and now i am loving python!
I can't stop my thumb for liking every video of urs....very helpful sir❤....
Ans of the quiz : Telusko
Rocks
Thank you so much sir for teaching python in such an easy way
Bro what are u doing for certificate
omg now i got addicted to this Python Series man ! thanks a lot for your videos bro
Excellent way of teaching sir 🙏,requires lot of efforts also time,this is d result of ua Hard work n patience 🙏
I like all the parts till here I will see all the vedios of the playlist👍🏻👍🏻👍🏻💯💯💯💯💯💯💯
Superb explaination sir,and it is very easy to learn
Thank you so much for making this video 👌👌👌
Bro today was my exam on python and this helped a lot
'DA CHEATING' * 100
@Miss omal You won't understand :)
@Miss omal ma, nothing. He did not study before the exam but he saw this video and he passed in front of his classmates. That's why it's like cheating
As a lecturer you are giving us ultimate.
And really we are respectful every time when we watch your videos
10:03 it is considering "space" also as a character.
Nice intro video to variables.
Tqsm for keeping the python programs ....
I enjoyed so much by seeing u r vedios...
👇2024 Attendance!
This is really a great course and amazingly explained. I really do appreciate your contributions and help for student community. No doubt this is really a great python series. Though this was updated in 2018 and recently there is no new update in this series. Do you have any plan to add more into Python course?
This series of videos are just too easy to follow. I am elated to come across them. Thank you, Mr Navin.
I love your classes sir.. so much helpful for a beginner.. thank you so much for taking time to create videos and we will support you all along
I cant believe that i'm still learning new stuff in python after almost 2 years of working with it!!!
Wow YOU make it sound so simple and easy. i always had inhibition about coding in "Python" and pursued it as a Rocket Science! but with the help of these videos I think I'll soon be there.. Kudos :)
Thak u so much sir
U gave me a goal of my LIFE
What are you doing brother
Thank you Navin I was really hopeless in learning python...
But watching your video makes me feel it's a piece of cake.. thank you so much for your efforts❤
Awesome explanation sir. Now I am very clear about Python. And it's very interesting too.
🤓 Quiz Answer 🤓
Guess the Output
print (r'Telusko
Rocks')
Answer : Telusko
Rocks
That's wrong... The output shoul be: Telusko
Rocks
.... As that '/n ' is used for a new line...
@@raziabegum9618 nah @MILAN BARIYA is right coz that r stands for rawstring watch that 3rd video skip to the 3/4 part
@@raziabegum9618 r makes it rawstring
If you want to your output as it's , please use //in stead of/......now you will get your output as it is... 😄
@@raziabegum9618 MILAN is right the answer is Telusko
Rocks because its a raw string we cant change that
Bro Navin U are insaane ................enjoying the series too much
You = "NavinReddy"
'MR ' + You {6: }
God Bless You always For this Kind Work for us , who can't afford high Fees.
You've made python super easy....I'm loving it.
Also do you provide notes, would be really helpful.
I cannot go without leaving comment this is the best video since I started learning python. thanks you a lot .
name='navin reddy'
feeling ='Thank you'
print(feeling+name)
Hi Sir, your tutorial is very helpful .Thanks
Their is nothing like a teacher that knows his subject. That would be you. Try to learn from a teacher that does not really know his subject. Good luck. You are the best. Thank you again!
Guru = "Navin Reddy Gaaru"
Thanks= "Thank You Very Much"
Finally
print(Thanks + Guru )
name = ' sanjeev'
message = ' welcome to piecharm'
print('hello' + name + message)
Channel name "telusuko" means get to know ...... n yes we r getting to know about Python...😃🙏
n="best"
>>>'my life'+n[0: ] + 'lecture'
How to print two letters alone? Say y and e?
'y ' + 'e' i guess
Sir you are really great. you made all the things so easy. and thanks for making these videos in English. Love from Bangladesh.
Telusko Rocks sir
10:10
Telusko
Rocks
Superb sirr by this so many members rr getting this course freely and can easily understand by u super explanation ........
Telusco
Rocks
name = "youtube"
name = "my" + name[3:6]
print(name)
here strings are mutable
You can add something with the string but you can't replace the string with another word
Your teaching method is brilliant, speed and method of teaching is really fantastic, I am watching it without any distraction 👍
who is learning python october 2019 like this
Ranjeet Singh hey! I started yesterday
I started last night !!
I started today
Started today!
Strtd tody
those who clearly understood the meaning of variable, here>>>
print ('Me too')
You are just an awesome teacher, you explain it with such a clarity and make it so easy.
Thanks a lotttt.
Sir...Are you from Telugu? wow.. I'm really Surprised.. Such a talented..నమస్కారం sir🙏😍
print(r'Telusko
Rocks')
Output:
Telusko
Rocks
sohel rana this is called raw string
remove the "r" then you will get
Telusko
Rocks
okay :)
I want learn python .. can you guide me sir nd am big fan of yours can you guide me 8076770117 my contact no
wow, this guy is the best , I have been watching a lot of videos about it
"Oh it works"
Answer for Quiz Question:
Telusko
Rocks
loving the series especially since I just started watching it ❣❣I have learned so much for just being on the 4 episode of the series, keep up the hard work!!
The output will be
'Telusko
Rocks'
Please correct me ....😬
i'ts "Telusko
Rocks"
a so called raw string.
Because of the r at the beginning... so the command to continue in a new line will be ignored in that way.
@@herecomesthepain4229 Quotation marks not included: Telusko
Rocks
I am really enjoying learning python just because the way you explain is simply amazing
as you said len() will gives the number of characters instead it gives results including spaces also , navin reddy has actually 10 characters but in your results it is comes 11.... so sir please help with it
and video is really really helpful and easy to understand not lengthily too .keep posting
Really looks simple when you explain things. Since coming from a non-coding background, this teaching technique method is really easy to understand.
>>> print ('Thanks Navin')
:)
Teaching Python from beginning superb..way of teaching extraordinary..
You are better than teachers at schools!
Hai Bro, I am 43 yrs old and now trying to learn Python, I am impressed by the way you created these videos which are very interesting and helpful to the viewers, keep going keep roks and God Bless You...
sir, this course is like finding a coca cola in the middle of the desert. i was taking a course at my uni about this language but it was so complicated and then i find this playlist, thank you very much for sharing this