text

Experiment Guidance for Data Visualization

  • Class:

  • Name:

  • ID:

    (Reference for markdown grammar: https://www.appinn.com/markdown/ )

Experiment 1:Python Basis

Objective

  • Familiar with Python IDE;
  • Master the python grammar;

Tools

  • PC
  • Python IDE

Content

  1. Write a program that accepts a sentence and calculate the number of letters and digits.
    For example,
    input : hello world! 123
    output: LETTERS 10
    ​ DIGITS 3

    Hints:
    In case of input data being supplied to the question, it should be assumed to be a console input.

    """Write python script here"""
    
    

    %%%%%%%Took a screenshot of your result and paste here%%%%%%%%

​ %%%%%%%%%%%%%%% %%%%%%%%%%%%%%%

  1. Given an integral number n n n, write a program to generate a dictionary that contains ($ i $, i ∗ i i*i ii) such that is an integral number between 1 and n (both included). and then the program should print the dictionary.
    For example,
    input: 8
    output: {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64}

    Hints:
    In case of input data being supplied to the question, it should be assumed to be a console input.。

    """Write python script here"""
    
    

    %%%%%%%Took a screenshot of your result and paste here%%%%%%%%

​ %%%%%%%%%%%%%%%

  1. A website usually requires the users to input username and password to register. Write a python program to check the validity of password input by users.
    The following are the criteria for checking the password:

    1. At least 1 letter between [a-z],

    2. At least 1 number between [0-9],

    3. At least 1 letter between [A-Z],

    4. At least 1 character from [$#@],

    5. Minimum length of transaction password: 6

      6.Maximum length of transaction password: 12

    Your program should accept a sequence of comma separated passwords and will check them according to the above criteria. Passwords that match the criteria are to be printed, each separated by a comma.
    For example
    input: ABd1234@1,a F1#,2w3E*,2We3345
    output: ABd1234@1

    Hints:
    In case of input data being supplied to the question, it should be assumed to be a console input.

    """Write python script here"""
    
    

    %%%%%%%Took a screenshot of your result and paste here%%%%%%%%

​ %%%%%%%%%%%%%%%

Summarization

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值