I don't know how to put Python Wang Beginner 6000 in five digits.

Asked 2 years ago, Updated 2 years ago, 14 views

<Problem> I'm going to place an order. You can order by entering the product name, price, and purchase quantity. Examples of outputs are as follows. (However, the price of the product does not exceed 99999 won.)

 [Input example 1]
apple

6000

3

[Example 1]
The price of apple is 06000 Won

You ordered appleappleapple

The problem is the top. In my case, I applied this code, but should I use the conditional statement? And I don't know how to express 6000 in five digits.

It's my code.

a=input()

b=int(input())

c=int(input())

print("The price of %s is %d Won" %(a, b))

print("You ordered %s" %(a*c))

I don't know how to use if or how to express five digits. I look forward to hearing from you!

python

2022-09-20 15:06

1 Answers

How to express 6000 in five digits using conditional statements

What if the number "if" is less than 10? → Since it is a number of digits of work, if you put the number after → 0000 and show it, → 5 digits

What if the number "else" is less than 100? → Since it is a decimal place, if you put the number after → 000 and show it, → 5 digits

What if the number "else" is less than 1000? → Since it is a hundred digits, if you put the number after → 00 and show it, → 5 digits

What if the number "else" is less than 10000? → Since it is a number of digits in the cloth, if you put the number after → 0 and show it, → 5 digits

What if the number "else" is less than 100000? → Since it's a unique number of digits → If you just show it, it'll be 5 digits

60? Here, the number "If" (if) → → Jared Lee Gosselin because it is less than 10000

PS. If you just want to get the right answer after skipping the basic course? https://stackoverflow.com/a/339013/8680764


2022-09-20 15:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.