We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e698c2 commit fd016feCopy full SHA for fd016fe
questions/float_add.py
@@ -0,0 +1,2 @@
1
+""" Print the result of `0.1 + 0.2 - 0.3`. """
2
+print(0.1 + 0.2 - 0.3)
questions/float_add_1.py
questions/int_program_1.py
@@ -0,0 +1,13 @@
+"""Compute how many potatoes I can buy."""
+
3
+potatoes_in_store: int = 1000 # total number of potatoes
4
+cost_for_all_potatoes: int = 50 # cost if we would buy all potatoes
5
+my_money: int = 10 # the money I have
6
7
+# Compute the cost of one single potato.
8
+cost_per_potato = cost_for_all_potatoes // potatoes_in_store
9
+print(f"One potato costs {cost_per_potato} RMB.")
10
11
+# Compute the number of potatoes that I can buy with my money.
12
+i_can_buy: int = my_money / cost_per_potato
13
+print(f"I can buy {i_can_buy} potatoes.")
0 commit comments