As we mentioned in the first post python, this is a dynamically typed language but also strongly typed.
In python we have the following basic types: Boolean
- Numbers (integers, decimals and complex) chains Text
Syntax to declare boolean: = True
algoVerdadero
algoFalso = False Syntax to declare
numbers:
# So to declare variables numeroPositivo
integer = 10 = -15
numeroNegativo
# A float variable
numeroFloat = 2.0254
numeric operators:
a = 5.0 b = 3.0
print (a + b) # print -> 8.0
print (ab) # print -> 2.0
print (a * b) # print -> 15.0
print ( b ** b) # print -> 9.0, representing 3.0 ^ 3.0 (power)
print (a / 5) # print -> print
1.6666 (a / / 5) # print -> 1, is the integer result
print division (a% 5) # print -> 2, is the rest of the division
Syntax to declare strings
a = "Hello"
b = "World"
print (a + b ) # print "Hello World"
print (a + (b * 2)) # print "Hello World World
If you want to begin to develop in Python THIS LINK you will find information about the interpreter and IDEs.
0 comments:
Post a Comment