python--the license plate number of the traffic accident

Source: Internet
Author: User

Example:
a truck violated the traffic rules and ran away after hitting people. Three people witnessed the scene, but did not remember the car number, only to note some of the characteristics of the car number. A said: The first two digits of the licence are the same; B said: The last two digits of the licence are the same, but different from the first two; C is a mathematician, he said: The four-bit car number is exactly the square of an integer. Please ask for the car number according to the above clue.

1 #!/usr/bin/env python2 #-*-coding:utf-8-*-3 forAinchRange (9+1):4 forBinchRange (9+1):5i = A * 116j = b * 117 ifI! =J:8n = i * 100 +J9 ifInt (n** (1/2)) **2 = =N:Ten Print(n)

Execution results are: 7744

python--the license plate number of the traffic accident

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.