#10 Python Tutorial for Beginners | Data Types in Python
ฝัง
- เผยแพร่เมื่อ 1 ส.ค. 2024
- Check out our courses:
Enterprise Java Spring Microservices: go.telusko.com/enterpriseJava
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com/masterjava
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
Spring: go.telusko.com/udemyteluskosp...
Java:- go.telusko.com/udemyteluskojava
Java Spring:- go.telusko.com/Udemyjavaspring
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
In this lecture we are discussing about DataTypes in Python:
-- why it is important?
-- how to use it ?
Python has several built-in data types. Here are some of the most common ones:
i) NoneType: This is a special data type that represents the absence of a value. It is similar to null in other languages.
ii) Numbers: These can be integers, floating-point numbers, or complex numbers.
iii) Booleans: These are values that represent True or False.
iv) Lists: These are ordered collections of objects, enclosed in square brackets.
v) Tuples: These are similar to lists, but are immutable (i.e., their contents cannot be changed), and are enclosed in parentheses.
vi) Sets: These are unordered collections of unique elements, enclosed in curly braces.
vii) Strings: These are sequences of characters, enclosed in single or double quotes.
viii) Ranges: These are immutable sequences of numbers, and are commonly used to iterate over a sequence of numbers in a for loop.
ix) Dictionaries: These are collections of key-value pairs, enclosed in curly braces.
i)None Type
a=None
type(a)
ii)Numbers
int: if you want to assign a integer value to a variable
a=5
type(a)
float: if you want to assign a float value to a variable
num =2.5
type(num)
complex: if you want to assign a complex value to a variable
num =2+9j
type(num)
type conversion: if you want to convert one data type to another data type
a=5.6
b=int(a)
type(b) # output : int
k=float(b)
type(k) # output : float
c=complex(4,5)
type(c) # output : complex
iii)boolean: if you want to assign a variable with a boolean value
a= True
type(a) # output : bool
bool=3 less then5
True
type(bool)
Sequence data types : if you want to assign a variable with multiple values
List, Tuple, Set, String, Range.
iv) List if you want to assign a variable with multiple values and you want to change the values
-- In Python, a list is a collection of ordered and mutable elements enclosed
in square brackets. Lists are one of the most commonly used data structures in
Python because of their versatility and flexibility.
lst=[25,36,45,12]
type(lst) # output : list
v) Tuple: if you want to assign a variable with multiple values and you donot want to change the values make immutable
-- In Python, a tuple is a collection of ordered and immutable elements enclosed in parentheses.
Tuples are similar to lists, but they cannot be modified once they are created, which makes them
useful for storing data that should not be changed during the program's execution.
t=(25,36,45,12,7)
type(t) # output : tuple
vi) Set: if you want to assign a variable with multiple values and you donot want to change the values and you donot want to duplicate values
-- In Python, a set is an unordered collection of unique elements enclosed in curly braces.
Sets are useful for storing data that should not contain duplicates, such as a list of
users on a website.
s={25,36,45,12,25,36}
type(s) # output : set
#output: {36, 12, 45, 25}
vii) String: if you want to assign sequence of characters to a variable
-- In Python, a string is a sequence of characters enclosed in single or double quotes.
Strings are immutable, which means that they cannot be modified once they are created.
str = "hello"
type(str) # output : str
we are not talk about char data type in python
st='a' # every character is a string in python
viii) Range: if you want to assign a variable with multiple values and you don't want to change the values and you want to generate a sequence of numbers
-- In Python, a range is a sequence of numbers that is immutable and iterable.
Ranges are commonly used to iterate over a sequence of numbers in a for loop.
range(10) # range data type
type(range(10)) # output : range
list(range(2,10,2)) # output : [2, 4, 6, 8]
ix) Dictionary: if you want to assign a variable with multiple values and you donot want to change the values and you want to assign a key to each value
-- In Python, a dictionary is a collection of key-value pairs enclosed in curly braces.
Dictionaries are useful for storing data that is associated with a key, such as a list of
users on a website and their corresponding email addresses.
d={1:'a',2:'b',3:'c'}
type(d)
d1={'navin':'samsung','rahul':'iphone','kiran':'oneplus'}
d1.values() # output : dict_values(['samsung', 'iphone', 'oneplus'])
d1.keys() # output : dict_keys(['navin', 'rahul', 'kiran'])
d['rahul'] #output : 'iphone'
d1.get('kiran') #output : 'oneplus' - วิทยาศาสตร์และเทคโนโลยี
I'm searching for the one who can teach me good but found the best, u r really amazing sir,I have suscribed ur channel and also suggested my friends those who are dying to learn python like me...tq so much sir 🙏
A fantastic jobb done by a knowledgeable person. I wish you were my tutor in college.
Your efforts are much appreciated. Thank you
Hi Navin, could you please also provide exercise sheets so that we can get good practice on each topic as soon as a video is finished.
We see
Yes true
Yeah
U could it would be great
google
You are one of the most most best Language-TH-camr among other Language-TH-camrs who doesn't confused to their viewers ...👍👍👍
You explained everything in a practical and fun way. Thank you for your videos.
This is an incredibly fast way to learn this. Thank you.
You are really a best teacher. Even school kids can learn python when you teach. Im very happy that i found you
Hello Sir, I love to watch this series. I have always watch your video whenever I was stuck or learn a new thing about software development. You made a great video for student who wants to learn from basics and reach to advances.
Great teacher in this era still watching in 2024😊
Same here
For those who are getting an error when using range(10) and then list(range(10)), try closing IDLE then try it again. It worked for me.
worked for me also
Worked for me!! :) can you state the reason behind closing and re opening?
@@ayushiajit3088 Not sure to be honest. But what I can think of is that reopening refreshes IDLE in some way.
Worked for me
me too
I am learning python first time and your tutorials are really helpful. Hope to follow this playlist till end.
Excellent teaching! I HAVE JUST WATCH 10 VIDEOS OF NAVIN SIR AND I AM FULLY UNDERSTAND HOW TO DO CODING.EXCELLENT TEACHING SIR! U WILL LIVE 1000 YEARS.
sir you are like Guru Dronacharya to me these videos are so helping me to gain my pragmatic knowledge in python. sir i was totally zero in coding but now due to your teaching im building my interest in coding thank you so much for this and please keep inspiring and educating us as u do .......lots of support and love :)
And sir please upload some exercise sheets after your videos so that we can practice it.....
Hi Navin, Thanks for your great tutorials . In this video having a minor correction at 8:46 . Other modern programming languages ( like "Swift Programming Language" ) also supports "Range". In Swift, having dedicated range operators ( "..." , "..
Your way of teaching is excellent sir..before watching your classes, i am afraid of doing coding but now i have got a lot of confidence that's all because of sir...Thank you for sharing your knowledge to us....
Amazing explanation, Telusko, Greart Work, Thanks a lot. You are in my list of Wonderful Mantor.
Thanks for your vedios I wanted to learn python for machine learning and these basics helped me to grade up faster
I am actually referring a lot of resources right now as I am going into the IT industry through data science, AI and ML, and to be totally honest, I have found some tips and tricks that I did not get in other tutorials. Kudos for that, keep up the good work. Thanks for such an amazing and selfless content. I would still like to ask you if you have any other resources that would help me in my journey ahead, do let me know in the reply.
Sir u r awsm i have watched all ur last python tutorials and its helping me a lot thnx once again
marvelous presentation by Navin Reddy. Very precise. Thank you for your time for educating all. Great job.
U are really fantastic sir, just provide notes or exercise so we can practice all if u can
Thanks for such a dedication to ur youtube channel.and helping us grow.
What a great session! Thank you Navin.
I am practicing the lessons you are teaching in my computer. My computer has python 3.7 so I am able to practice whatever you are explaining. And these are very helpful to me. Thanks a lot for the lessons you are teaching to me.
Hi navin, it was so good to learn from your videos. Having so much fun in watching your videos, i mean you explain so clearly each and everything. Love you man. Please do create more videos.
thank you so much man, Day after tomorrow is my python exam, and you made it easy for me
Very good explantion Navin. Thank you!
Your learning style is awesome so we are understand every chapter clearly
What an amazing person u are... Hats off to u for teaching such a tough subject in a very funny way.. really ur the best sir. Tq Soo much
Didn't find better videos than yours.
Thankyou Sir😊
I am finding your variables so informative. Looking forward to more videos.
Yep..his teaching is good !
Your truely an inspiration sir.I love to learn python since iam from Civil Background.your such an amazing person teaching in a simple way.thanks for all the things sir.your my guru forever
Your teaching style is simple and clear
Anyone can easily understand by your teaching
🤓 Quiz Answer 🤓
How to access the help docs in python?
Answer : " help( ) " using this command we can access the docs in python.
" help ( "LISTS" ) We can also use this command to search for specific topic in help doc.
No bro we should not use hypen symbol
answer:
help( )
help(topics)
Sailing smoothly so far with captain navin.
How beautifully you explain..such concepts..crystal clear 😍👌👌
Sir,really ur doing great job.Very helpful to us.Enjoying your classes sir.Thank you so much GURUJI.
It's very helpful. Thanks Navin.
12:22-12:31
"you have to use curly brackets
now why curly brackets because keys should not repeat
and what doesn't repeat
set
and set uses curly brackets
so it makes more sense here"
what an amazing explanation :)
Yeah even i am blown out its awesome way of explaination
that means you shoudn't assign more than one value to one key
what happen if you define multiple key with same name and values of them will be different
@@arunbisoyi the last duplicate key will be considered instead
The efforts that you are putting to make this video is awesome...keep going...
U r explained in vy simple way reall u r super bro tquu 🤩🤩
Thank you sir.. concepts are getting cleared
Tomorrow I have exam,this is very helpful thanks😘
Quick and precise! I guess I have to write the same thing to make comment on your every lesson!! Thanks again for sharing the light.
Thank you Mr. Reddy ,your videos are really very helpful for me day by day
You are doing a good job to make it easy, understandable, and intuitive. For instance, why curly brackets are used for Dictionaries? Because keys should not repeat and what does not repeat - set." 🤯 😲 Damn! Now, I know why they both used curly brackets. Thanks for the tutorials.🙂
omg-such a transparent explaination..nice..i studied python here and now my aim is to become a data scientist
Hello
Are You a Data Scientist now ?
If yes
Plz let me know the protocol for it !
@@saigoudshakaram7805 no sir..i am still studying 12th grade and data science course
Ho Good
From where Are you persuing the course ?
Thanks a lot for all Python tutorial videos.
Hello sir, your teaching is very nice and im new to python and i am sincerly able to learn from you..and i hope u keep teaching like this and make more videos of this language :)
in order to access documentations
type:
help("what ever doubt in the topic")
example-help("STRINGS")
Sir I like your speed it's perfect for me and u r good teacher
Dude you're the one who actually posted this comment here 6 days ago. So would you mind helping me out?
I watched the "more on variables" video and I do understand that the address and variable value in related. I also understood how it changes when you set a new value to a variable. But my question is now in this video, in the update function he is passing the value of x...and x is set to 8. So when he calls the function without any arguments ..it' should output 8. When he put in the value of 10 it still made sense as it output 8. But what I don't understand is that when he sets a new variable a and then sets it as 10, the function suddenly changes and outputs the value of a....which isn't supposed to happen as in the function itself the value of x only is used and hardcoded right?
i love your cocncept clearing session sir i m a student of great learning and here i can clear my concept often more clearly thanks@telusko
thanx for your huge effort and really do appreciate the way you explain. although the best ever python tutorial ive never crossed, you did give me the hope to study programming language . in fact if you drop exercises at the end of the course might be great. if does anybody ready to help me study python language always welcome, seriously id like to learn this programming.
Hi Navin sir , could you please also provide exercise sheets so that we can get good practice on each topic as soon as a video is finished.
every time you say 'kiran' in any video, my face kinda lits up lol
😂
now im loving programming only because of you Navin. great job
you are my favourite python youtuber thanks for being so helpful
If we need to access the HELP doc in python, we can simply call the help() function. If we know the particular keyword of the topic we are seeking help for, we can also write it as : help("LISTS")
[13:40] I have a key, I have a value. Hamm value-key :)
Thank you fot tutorial :)
very few got the joke, by the way this joke is derived from the song pineapple-pen . isn't it funny now?
Ok I get it
@@S-I-D-D-H-U xD
Nice English
TRUEEE LUBBBBB thanks man may u achieve lot more successs!!!
Thanku very much sir🙏.your teaching is really awesome and helpful. I am in first yr and I was truly looking for this type of tutor. Koncham practice cheyadaniki iste inka manchi untunde, but I'll get it. Thanku once again sir. 🙏🙏
ans: type "help()" in cmd interface
You can simply access help docs by typing help()
Sir.... U r awesome...... The way u explain everything..... Is very easy to understand...... And thank you so much..... For your support..... 😊😊
Better understanding tutorial 👍👍 I have ever seen in youtube
sir i have one doubt - Does python separates list and set just by "[]" and "{}"?? so why they make two different things if they are same -_-
and same thing as tuple.
Pleas get bavk to video number 6 in this series. Navin explained the differences there
List = Collections of values (same or different and they are modifyable)
Set = doesn't mantain a sequence and doesn't support dupplicates
if you compare this with JS, it will be easy to understand .
Dear Navin, Is there any website so that we can also practice python programing
Download sololearn app. From that we can practice any language whichever we want. And we also can learn through that app.
This is best course about python I’ve ever seen. You are a great teacher, a Guru.
Wonderfully explained and in a fun manner. Great going. Thanks
why we didn't use list[range(10)]
as we should use sq bracket in case of list
it gave error
Tuple, set, list has different brackets.. each bracket defines their corresponding data type...
You use sq brackets when defining lists, - however, the word "list" here does not mean that you are defining a list. Here it's the name of a function that converts a given value to a list - and you pass values to a function using normal brackets.
when am using list(range(10)) showing TypeError: 'list' object is not callable
harsha kotta
Yes same thing
@@dilkashgazala831 you both may defined list earlier. First run quit() then again run it and it will run
Bro,L in list word should be Capital.Glad for help😊
If you sir be the lecture of my class of programming.Then suerly me and our class student get the full knowledge of programming.Thank you for teaching us with the better way😍
Ur teaching is Matchless, very helpful.
Deep knowledge
write help() and press enter key
hi bhakti
Are u a developer in any company
coz of you this video have 22 dislikes -_-
@@PrakashPatkinanded no
sir ,should i make notes of your videos?
Obvious
Revisiting the lectures after a long gap. Great lectures as usual
You are very good in teaching. I really appreciate you
Quiz: How to access the help docs in Python?
Ans: Thru the function help() without any arguments, then the help console will open.
help()
also help(OBJECT)
We need to put it within quotation [single or double] like help('LISTS')
List(range(2,10,2)= even
How it in prime numbers
Wow sir , it is so easy and fun to learn from you. Your energy, vibe and way of teaching is so amazing, easy and to the point. Thank you so much and keep teaching.
Have got great clarity regarding different data types, how and where to utilize them👌. You have taught diving into the depths step by step in a fantastic way, also a quick revision of the sequence data types👍. Thank you very much really loved and enjoyed it❤
Are you Telugu sir
May be
Yeah
He is Saitama
Quiz: initially we need to create a environment for that particular path. Then only python will enable. we can use help function to list out all commands. if we need particular command like LIST function. we should type help['LIST'].
I loved you videos .. im trying to learn python from a long time but your videos are the best.❤
Nicely taught by Navin ,better to understand
Thank you sir for your free sessions of python . It symbolizes that there are good people on earth who gives knowledge in exchange of time not money
Thank you Sir !! Great Python Series .
You are My Mentor.......!!!
Great to Have a Mentor like "You".
Thank you very much for this video! It was very clear and helpful for me :)
Very very very well thought..sir awesome level of explaining superb ...respect to u
It's really very helpful ...thank u so much.... keep doing this type of work.. simply great 👍
Your accent and teaching skills are excellent. U r teaching is simply superb. Iam a teacher. I love u r body language and confidence of u r teaching abilities 🙏🙏🙏🙏
Superb sir what a teaching .... u had a good teaching skills sir
Thanks a lot for the tutorials !!! Really helpful
I am realizing now that Telusko in telugu means 'Get to Know'. Great name for a channel : )
I appreciate your effort Navin. Very very useful videos
I am a social science student but able to understand everything. Thank you sir
who is enjoying in 2022? Honestly thank you so much sir being consistency. meanwhile you got a new subscriber, @Telusko!! inka teluskovadaniki chala undhi sir. 😂
Very understandable and enjoyable
Thank you Sir
have to say
you are literally amazing
keep it up
great bro ,nuvu super ga explain cheysav