Geliştiriciler için Python’a Giriş
Jasmin Ludolf
Senior Data Science Content Developer
$$
$$
$$
new_ingredient_quantity = 1.5
$$
$$
is_in_stock = True
is_in_stock = False
type()
String
ingredient_name = "tomatoes"print(type(ingredient_name))
<class 'str'>
Integer
ingredient_quantity = 2print(type(ingredient_quantity))
<class 'int'>
Float
new_ingredient_quantity = 1.5print(type(new_ingredient_quantity))
<class 'float'>
Boolean
is_in_stock = Trueprint(type(is_in_stock))
<class 'bool'>
type() kullanın
Aritmetik operatörler:
+ toplama- çıkarma* çarpma/ bölmeSayılar:
print(2 + 1.5)
3.5
String'ler:
+ ve * çalışır"Hi" + "There" = "HiThere"
"Hi" * 3 = "HiHiHi"
Geliştiriciler için Python’a Giriş