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
-
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 3Hints:
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%%%%%%%%
%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%
-
Given an integral number n n n, write a program to generate a dictionary that contains ($ i $, i ∗ i i*i i∗i) 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%%%%%%%%
%%%%%%%%%%%%%%%
-
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:-
At least 1 letter between [a-z],
-
At least 1 number between [0-9],
-
At least 1 letter between [A-Z],
-
At least 1 character from [$#@],
-
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@1Hints:
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%%%%%%%%
-
%%%%%%%%%%%%%%%