Bot-Tech - online Programming Learning Platform.

Python tutorial, Online learning, SEO mastery, Blogging, Youtube, latest tech news, Web development, How to fix, Best of and Programming languages learning for free.

Wednesday, June 19, 2019

Variables in Python | Python tutorial for beginners | Python Basics #4

Variables in Python | Python tutorial :

:-- let's continue with this series on Python in fact in the earlier videos we have talked about what is Python we have installed two software's and we have also worked with certain operations right we had fun in the last session now in this video where I talk about what is variables.
Variables in Python | Python tutorial for beginners | Python Basics #4


:------ watch video tutorials | Python Tutorials for beginners---------:

#4 Python Tutorial for beginners | variables in Python:


in this Python video tutorial we will see:

  • what is variable
  • why do we need them
  • how to assign value to the variable
  • fetching values in the previous operations
  • fetching values string variable by index number
  • finding the length of string


what is variable?

basically Python variable is a container where you can put your values. an example we are storing to here in a container and the name of that container is X, of course, you can give anything it doesn't matter you can say ABC you can say a box you can give any name. 
Variables in Python | Python tutorial for beginners | Python Basics #4

so we are storing to here in a container and the name of that container is X
and the value is 2. 
Variables in Python | Python tutorial for beginners | Python Basics #4
now we have a variable and value. 

how to assign value to the variable:

1st.
x=2
now
x + 67
result: 69
2nd.
x='Bot-'
now 
x+ 'tech'
result: Bot-tech

fetching values:

see the examples:
Variables in Python | Python tutorial for beginners | Python Basics #4

name= 'youtube'
name=[0]
result: 'y'
name=[1]
result: 'o'
name=[7]
result= 'e'
More examples:
name='youtube'
name=[1:4]
result: 'out'
name=[0:3]
result= 'you'
name=[2:]
result: 'utube'
name=[:2]
result: 'yo'
 changing variable:
name='youtube'
Now I to want to change the variable 'youtube' to 'mytube'.
name='youtube'
'my '+name[3:]
result: my tube
>>Python tutorial for beginners | basic #3 

Conclusion:


I hope you liked the post. And all the points you told me will come to understand. If you have a question similar to that, then you can ask us by commenting. If you liked the post, please share this post with all your friends on social media. Also, B-T to Follow aware of all the new posts and can continue to receive. 


No comments:

Post a Comment