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 :: python unsigned to signed integer 
Python :: python download progress bar 
Python :: python open application 
Python :: how to make an application using python 
Python :: pandas merge validate 
Python :: tkinter call function in mainloop 
Python :: wikipedia api python 
Python :: python set console title 
Python :: python polymorphism 
Python :: python select random number from list 
Python :: range() in python 
Python :: shuffle function in python 
Python :: sort 2d list python 
Python :: typing python 
Python :: python oops 
Python :: install python 3.7 
Python :: math in python 
Python :: python list remove all elements 
Python :: program to count the number of occurrences of a elementes in a list python 
Python :: how to print multiple strings on one line in python 
Python :: where python packages are installed 
Python :: scaling 
Python :: how to work with django ornm __in 
Python :: for en python 
Python :: find the range in python 
Python :: use of self in pythonic class 
Python :: python xgboost 
Python :: how to make a calcukatir un python 
Python :: dataframe coulmn to list 
Python :: numpy find index of matching values 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =