【Ready Player】【Python】【Lanqiao Cup】

foreword

In a blink of an eye, there are only 9 days left. I studied too hard a few days ago, which led to bad results. I also advise everyone that before the exam, it is better to control your diet and work and rest, and sleep more than to watch short videos.
At the same time, strengthen the feeling of text, whether it is Chinese or English, the information obtained through text is faster than in video, but video can indeed assist in understanding, especially for some powerful creators, but the first thing to do is to digest by yourself Hands-on knowledge is still very important. For example, when chatgpt was first released, the country was catching up with the epidemic at that time, and most people didn't care about it. But in those few months, the value generated through chatgpt was great. At that time, I also I was preparing for the final exam, and then I missed the most golden time of GPT. Although I played a lot of AI derivatives later, if I missed the time, I missed it.
For the recent GPT plugins, I have applied for 5 mailboxes but have not passed, I cried to death.
Okay, let’s get to the point, let’s do some filling-in-the-blank practice today.

1. Special numbers

insert image description here

for i in range(10,10000):
  b=str(i)
  a=int(b,16)//妹想到吧
  if a%i==0:
    print(i)
    break

Base question?
Python: What a weak chicken,
one-handed string conversion to hexadecimal, and the hexadecimal question is firmly grasped

2. Number of sequences

insert image description here

import itertools
ans=0
for i in itertools.combinations_with_replacement(range(1,11),5):
  if i[0]<=i[1]<=i[2]<=i[3]<=i[4]:
    ans+=1
print(ans)

Itertools is a tool that I believe you have seen a lot. The first parameter of combinations_with_replacement(a,b) is the range of values, the second is the number of elements, and then a list table is generated.

3. Uppercase

insert image description here

s=str(input())
print(s.upper())

Perfect

4. Week calculation

insert image description here
This question is to find the relationship with the cycle, 20%7=6, and (-1)%7=6, so the two are equivalent, (-1) 22 =1, just add one

epilogue

Well, after doing a few questions, I went to the movies. The number one player pushed on the homepage of station B, so to speak, it gathers the dreams of all science and engineering men, but it is not the Chinese version, what can I say? Goodnight!

おすすめ

転載: blog.csdn.net/weixin_53415043/article/details/129843222