Académique Documents
Professionnel Documents
Culture Documents
print("x = %s" % x)
def sum(x,y):
c = x + y
return c
suma = sum(2,4)
print("x + y = %d" % suma)
def concar(x,y):
c = x + y
return c
a = "Ana are"
b = " mere"
print("a + b = %s" % concar(a,b))
x = 10
print("x = %s" % x)
x = 20
print("x = %s" % x)
x = 30
print("x = %s " % x)
print("Print with two parameters x = ",x)
y = 40
z = 50
print("Print with 3 parameters x = ",x,"y = ",y,"z = ",z)
a = 10
b = "abc"
'''
Identifiers must contain at least one character
The first character must be an alphabetical letter (upper or lower case) or
the underscore
The remaining characters( if any) may be alphabetical, the underscore or
digit
No other characters(including spaces) are permitted in identifiers
A reserved word cannot be used as an identifier
Case sensitive
'''
pi = 3.14159
print("Pi = ",pi)
print("or ",3.14," for short")