Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python tokens

#Python Token
#List of Python Tokens

 -Keywords
 -Identifier
 -Literals
 -Operators

-Kewwords: 
 Keywords are pythons reserved words, they convey a special meaning to 
 the compiler/interpreter. Each keyword has a certain meaning and a 
 certain opperation that it needs to carry out. Never use a keyword as 
 a variable as that could cause lots of complications and mistakes.

-Identifier:
 An Identifier is a name used to identify a variable, function, 
 class or object.
 Rules of Identifiers:
    ->No special characters exepct underscores(_),can be used as 
      an identifier
    ->Keywords should not be used as an identifier
    ->Python is case sensitive, Var with a capital V and var with
      a lowercase v are two separate identifiers
    ->The first character of an identifier can be an alphabet or 
      underscore but not a digit
     
-Literals:
 There are many types of literals such as the following
 Types of Literals:
    ->string literals
    ->numeric literals
    ->boolean literals
    ->special literals

-Operators:
 Operators are special symbols that are used to carry out aritmetic 
 and logic operations
 Various Types of Operators:
    ->Arithmetic
    ->Assigment
    ->Comparison
    ->Logical
    ->Bitwise
    ->Identity
    ->Membership
Comment

python tokens

"""
Tokens: Python breaks each logical line into a sequence of elementary
lexical components known as tokens. Each token corresponds to a substring
of the logical line. The normal token types are identifiers, keywords,
operators, delimiters, and literals, as covered in the following sections.

Keywords: Keywords are words that have some special meaning or significance
in a programming language. In Python we have 33 keywords some of them are:
try, False, True, class, break, continue, and, as, assert, while, for, in, raise,
except, or, not, if, elif, print, import, etc.

Identifiers: Identifiers are the names given to any variable, function,
class, list, methods, etc. for their identification.
Python is a case-sensitive language and it has some rules and regulations
to name an identifier.

Literals or Values: Literals are the fixed values or data items used in a
source code. Python supports different types of literals such as:
    
    String Literals.
    
    Character Literals: Character literal is also a string literal type in which
    the character is enclosed in single or double-quotes.
    
    Numeric Literals: Integer Literal, Float Literal and Complex Literal
    
    Boolean Literals: Boolean literals have only two values in Python. These are True and False.
    
    Special Literals: Python has a special literal ‘None’. It is used to denote nothing, no values,
    or the absence of value.
    
    Special Literals: Python has a special literal ‘None’. It is used to denote
    nothing, no values, or the absence of value.
    
    Literals Collections: Literals collections in python includes list, tuple, dictionary, and sets.
      
Operators: These are the tokens responsible to perform an operation in an
expression.
"""
# Operators
a = 12
 
 # Unary operator
b = ~ a
 
# Binary operator
c = a+b  
 
# Driver code
print(b)
print(c)

# Output
# -13
# -1
"""
Punctuators: These are the symbols that used in Python to organize the
structures, statements, and expressions. Some of the Punctuators are:
[ ] { } ( ) @  -=  +=  *=  //=  **==  = , etc.
"""
Comment

tokens in python

Token in python means- 
Small logical Unit
Comment

python tokens

#PythonTokens
*Keywords--> False,True,return
*Literals--> datatypes like bool,int,float
*Operators-->  arithmatic and logic computation like /,//,**,*,+,-
*Identifiers--> some random combinations of character like alphabets,digits,etc.
*Punctuators--> parentheses ( ) , braces { }  these are punctuators
Comment

PREVIOUS NEXT
Code Example
Python :: pip for python 
Python :: pine script to python 
Python :: group by data 
Python :: Issue AttributeError: ‘numpy.ndarray’ object has no attribute ‘index’ 
Python :: reference variable python 
Python :: find the range in python 
Python :: python tuples 
Python :: new line 
Python :: re python 
Python :: raspbian run a python script at startup 
Python :: list comprehension in python 
Python :: naive bayes implementation in python 
Python :: find last element in list python 
Python :: python function to do comparison between two numbers 
Python :: find max value in 2d array python 
Python :: read header of csv file python 
Python :: what does manage.py do 
Python :: label encoding of a column in python 
Python :: uninstall python kali linux 
Python :: comment multiple lines python 
Python :: tkinter pack align left 
Python :: how to make window pygame 
Python :: flask set mime type 
Python :: This code is supposed to display "2 + 2 = 4" on the screen, but there is an error. Find the error in the code and fix it, so that the output is correct. 
Python :: how to add background and font color to widget in tkinter 
Python :: how to make an action repeat in python 
Python :: Computation failed in `stat_flow()`: 
Python :: scikit learn split data set site:stackoverflow.com 
Python :: rapids - convert nerworkx to cugraph 
Shell :: ubuntu restart sound 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =