Vous êtes sur la page 1sur 1

x = 4

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"

print("The value of a = ",a," and the type is ",type(a))


print("The value of b = ",b," and the type is ",type(b))

'''
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")

Vous aimerez peut-être aussi