Python variables

Python3 variables

This lecture you will learn python variables!


Python Variable and Assignments

Variable is used to store a piece of value information it carries to where we require to use and store computers memory.
Rules for writing variables in Python
Letters (A-Z, a-z, 0-9 and _ )
Don’t start with number 
No spaces on variable name 
Special characters on variable name only(_)
CamelCase
snake_case_variable
number3isokFor

>>> number = 2
real = 2.2
world = “world”
print(world)
world
type(world)
  

>>> a = b = c = 1.6
print(a)
1.6
print(b)
1.6
print(c)
1.6

>>> one, two, three = 1, ‘two’, 3.0
>>> print(one)
1
>>> print(two)
two
>>> print(three)
3.0

Dynamic variable declaration 
number = 1
str = 'string'
number = str
print(number)
Output: string

Complete python course
All you need to know about standard and reserved keywords of python programming language, by type a keyword of formmowing command to you know your python version support reserved keywords.

>>>import keyword
>>>keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']

These specific keywords are for python don’t use these keyword names as variable name 
  
Python data science interview questions and answers python is a high-level programming language using Data Science programs these days

Data Science

Web development course Data Science courses: Web Development
Online courseOnline Courses: Include Certification
Harisystems is optimized for learning, testing and training. courses are designed to be simplified to improve reading and basic understanding for beginners to expert level. Tutorials and examples are constantly reviewed to avoid errors, however we cannot warrant full correctness of all content. if any found need to correct write us at info@harisystems.com. we Harisystems is not responsible for any with this tutorials, While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2007-2023 by Harisystems. All Rights Reserved.
Copyright © Harisystems 2023