I'm making an auction-style program for studying.
The bidders are Mr. A and Mr. B.
A's bid unit 10 yen
B's bid unit 20 yen
I would like to give out the winning bid and the winning bidder.
The successful bid order is Mr. A → Mr. B.
There are times when the highest bidder is displayed incorrectly.
I thought a lot, but I don't know how to display the successful bidder correctly.
kakaku = starting price
a_jougen = A's highest bid price
b_jougen = B's highest bid price.
total = kakaku num = 0 while True: num + = 1 if total + 10<= a_jougen: total + = 10 if total +10>a_jougen: break num + = 1 if total + 20<= b_jougen: total + = 20 if total + 20>b_jougen: break if num% 2 == 1: print ('A') else: print ('B') print (total)
Answer # 1
code total = kakaku num = 0 while True: if total + 10<= a_jougen: total + = 10 num + = 1 elif total + 10>a_jougen: break if total + 20<= b_jougen: total + = 20 num + = 1 elif total + 20>b_jougen: break if num% 2 == 1: print ('A') else: print ('B') print (total)
- [python, ffmpeg beginner] i want to get file information using ffmpeg on python
- python - input is not displayed,
- python - short text displayed in pysimple gui
- python 3x - i cannot understand the error message displayed by the jupyter notebook in the process of face recognition using dee
- i want to use variables in sql statement when converting the result of python sql query to data frame format
- about learning ai in python (beginner)
- python - about the problem that the output result changes when using multiple gpus with pytorch
- python - i want to store the result obtained by the for statement in an array row by row
- python - table is not displayed in admin (administration site screen) of django using mysql
- python - no output is displayed at the command prompt
- python - i want to make the result obtained by the for statement a two-dimensional array
- python - syntaxerror: invalid syntax is displayed
- python super beginner how to use find
- python - displaying the result of image recognition on the camera image in opencv
- i am a python beginner i want you to help me
- python - nothing is displayed when i execute it
- python 3x - python: no image displayed on canvas
- python beginner error message
- the prediction result of fx chart by lstm of rnn using keras in python deviates from the actual data
- python 3x - i want to aggregate the results displayed with the python print function and write them to excel
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- android studio - unresolved reference comes out in kotlin
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- python - importerror: cannot import name md5 error cannot be resolved