Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the interesting questions of Python?

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the interesting questions of Python". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what are the interesting questions of Python.

First, guess the numbers

The classic number guessing game, almost everyone can do it when they learn to program.

Function description: randomly select a number less than three digits as the answer. When the user enters a number, the program will indicate whether it is big or small until the user guesses it.

II. FizzBuzz

Function description: traverse and print 0 to 100. if the number is divisible by 3, it shows Fizz; if the number is divisible by 5, and if Buzz; is divisible by 3 and 5 at the same time, FizzBuzz is displayed. The result should be similar: 0Query 1, 2, 2, Fizz.4, Buzz.6. 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14.

3. AI of guessing numbers

It's the same as guessing numbers, but this time it's designing an AI that can guess numbers.

Function description: the user enters a number within a unit, AI uses the least number of guesses, and displays the number and number of guesses.

4. Tell the time on the hour

The old wall clock would strike the time on the hour, and the number of times ringing was equal to the time. We design a timer that runs on the computer.

Function description: after operation, there will be one long sound at each hour and two short sounds at half the hour. Sleep mode with no bell ringing from 12:00 to 6 a.m.

V. Review of sensitive words

You, who have always hated online censorship, have become the censors of a website, asking for censorship of terms that violate the rules on the Internet.

Function description: the post to be reviewed in this text document requires all harmony

VI. Word adventure games

You want to make a fresh and refined word game, running only in the black box of the command line.

Function description: try to refer to the mode of the RPG game, the game plot is self-edited, there should be a fighting mode, the protagonist has HP attributes, fighting and eating will have a corresponding increase or decrease effect on HP.

7. Statistics of word frequency

If you want to analyze the writing style of an English writer, you want to start with how often he uses words.

Function description: analyze the word frequency in this text document, arrange the results according to the frequency from high to low, insensitive to case, filter out punctuation (regular expressions can be used). The result is similar to ok:234,play:122,funny:78

VIII. Markdown converter

You always like to write articles in Windows's notepad. In order to easily generate web pages, you have written an article in Markdown format. Now you need a program to convert Markdown to HTML format.

Function description: convert the contents of this text document into an HTML document. To support Markdown tags as much as possible, the more the better. Regular expressions are recommended.

9. Mail bombers

A friend's birthday is coming, and you decide to play a prank by filling his mailbox with e-mail.

Function description: first register ten mailboxes, and then use this mailbox to take turns sending randomly generated email content to your friends. Adjust the frequency of sending to avoid being rejected by the server.

Control the computer by mail

Your computer is in the dormitory, when you are in the classroom, you decide to make a prank to scare the roommate who pretends to be ill to play games in the dormitory.

Function description: use email to send specific commands, let the program on the computer determine whether the sender controls the mailbox, and if so, execute the commands sent. Achieve as many functions as possible in different ways.

Thank you for your reading, the above is the content of "what are the interesting questions of Python?" after the study of this article, I believe you have a deeper understanding of what the interesting questions of Python are, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report