Joke Collection Website - Joke collection - How to write this python program, please write down the programming and ideas, thank you.
How to write this python program, please write down the programming and ideas, thank you.
This is actually solving a linear equation.
Suppose you can drink x bottles of beer, x empty bottles can be exchanged for x/2 bottles of beer without paying, and x bottle caps can be exchanged for x/4 bottles of beer without paying.
So, the equation is:
(x-x/2-x/4)*2= 10
The specific code is as follows:
x=4
Although correct:
if (x-x/2-x/4)*2== 10:
Print (x)
break
x+=4
The following is a screenshot of the operation:
- Related articles
- Humorous jokes about family relations.
- Asking for English joke articles
- Performance features of Pingxiang Chunluo
- Humorous jokes from all walks of life
- The biggest sorrow in life is that people are alive and money is gone.
- On WomenĄŻs Day, what weird activities has your company held?
- Example of composition: dead reading, reading about 500-600 words of dead books.
- Did Hu Xiao Long Yin marry Cao Shuang? Who plays Jia Jian?
- Lead painting | You are the only cat in her life! (including detailed tutorials)
- You tell this joke.