Skip to content

Commit c779276

Browse files
Add files via upload
1 parent 85a3307 commit c779276

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pyhton_study_1/page16/script.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apple_price = 2
2+
3+
# Receive the number of apples by using input(), and assign it to the input_count variable
4+
input_count = input("How many apples do you want?: ")
5+
6+
# Convert the input_count variable to an integer, and assign it to the count variable
7+
count = int(input_count)
8+
total_price = apple_price * count
9+
10+
print('You will buy ' + str(count) + ' apples')
11+
print('The total price is ' + str(total_price) + ' dollars')

0 commit comments

Comments
 (0)