January 24 "Basic knowledge of Python3"

Source: Internet
Author: User
January 24 "Basic knowledge of Python3"

3.4 Statistics String
3.5 Multiplication Formulas

3.4 Statistics String
# 统计字符串给类型符号个数s = n = f = 0st = input("随意输入字符:")for i in st:    if i.isalpha():        s += 1    elif i.isdigit():        n += 1    else:        f += 1print("字母有:{0}个,数字有:{1}个,其他符号有:{2}个。".format(s, n, f))print("输入字符长度:{0}".format(len(st)))
3.5 Multiplication Formulas
# 乘法口诀表for i in range(1,10):    for j in range(1,i+1):        print("{0}x{1}={2}  ".format(i, j, i*j), end="")    print()

January 24 "Basic knowledge of Python3"

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.