четверг, 1 октября 2015 г.

пост №1

в теле функции обязательно отбивать табом команды. таб == 4 пробела. Блять.
Что-то R мне нравится больше.

#comments

""" commentscommentscommentscommentscommentscommentscommentscommentscommentscommentscommentscommentscommentscommentscomments
"""

Now let's work with exponents.
eight = 2 ** 3
In the above example, we create a new variable called eight and set it to 8, or the result of 2 to the power to 3 (2^3).
Notice that we use ** instead of * or the multiplication operator.

Our final operator is moduloModulo returns the remainder from a division. So, if you type 3 % 2, it will return 1, because 2 goes into 3 evenly once, with 1 left over.

# comment's linemonty = Truepython = 1.234monty_python = python ** 2


Примитивнейшие задачки: 
1) 
You've finished eating at a restaurant, and received this bill:
  • Cost of meal: $44.50
  • Restaurant tax: 6.75%
  • Tip: 15%
You'll apply the tip to the overall cost of the meal (including tax).

# Assign the variable meal the value 44.50 on line 3!meal =  44.50tip = 44.50 * 0.15cost =  meal + tip
# Assign the variable total on line 8!

meal = 44.50
tax = 0.0675
tip = 0.15

meal = meal + meal * tax
total = meal + meal * tip

print("%.2f" % total)

Комментариев нет:

Отправить комментарий