Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- variables
- constants
- operators / operadores
- operands / operandos
- assignment operator / operador atribuição
- arithmetic operators
- boolean operators
- relational operators
- """
- a = 3 #assignment
- b = a #3 #infix operator
- #"array" - adjacent memory .... NumPy
- #c = list[f3(f2(f1(data)), 2, 3)]
- d = 3 ; e = 4 ;
- def infiniteCycle():
- while(True):
- pass
- #def end
- #d = infiniteCycle()
- """
- math operators
- """
- a = b = 3 #cascade assignment
- a = 3 ; b = 2
- aSum = a + b #5
- #aConcatenation = "a"+"b" # "ab"
- aDifference = aSum - 2 #3
- aMultiplication = aDifference * 2 #6
- #print ("--"*6)
- realDivision = a/b #1.5
- integerDivision = a//b #int(a/b) #1
- powerOp = a**b #3**2 = 3*3 = 9
- remainderOfTheIntegerDivision = 3%2 #1 #thousand applications
- #root of r-index
- #n**(1/r)
- sentence = phrase = sequenceOfSymbols = "" #double-quotes delimiters
- sentence = phrase = sequenceOfSymbols = '' #single-quotes delimiters
- a = "\"" #escape of double-quote
- a = '"'
- a = "All men are mortal."
- b = "Socrates is a man.\n"
- c = a+b #concatenation
- print (c, end="") #standard output
- print (c)
- c = "_.-^-."*12 #multiple-concatenation
- print (c)
- #stored-program computers Manchester MK 1
- #American Standard Code for Information Interchange
- #ASCII "ask-he"
- #2^7 = 128 #ASCII
- #2^8 = 256 #e-ASCII
- #2^16 = 65536 UNICODE
- print (2**16)
- """to know the e-ASCII table"""
- iSymbolCode = 65 #.. 255 #255-0+1 = 256
- strCode = str(iSymbolCode)
- strSymbolCode = chr(65)
- print ("Code: "+strCode+" Symbol: "+strSymbolCode)
- iSymbolCode = 66 #.. 255 #255-0+1 = 256
- strCode = str(iSymbolCode)
- strSymbolCode = chr(66)
- print ("Code: "+strCode+" Symbol: "+strSymbolCode)
- asciiCodes = range(256) #collection 0..255
- for iSymbol in asciiCodes: #walk over the collection
- strSymbol = str(iSymbol)
- strCorrespondingRepresentation = chr(iSymbol)
- strBothCodeAndSymbol = \
- "Code: "+strSymbol+" Symbol: "+strCorrespondingRepresentation
- print (strBothCodeAndSymbol)
- #for
Add Comment
Please, Sign In to add comment