Provide the Python Code for the Fol
Provide the Python Code for the Fol
2: Calculate and output the average age of this group of people (keep 2 decimal
places) and the number of males among them(Enter the name, gender, age and other
information of a group of people on the keyboard, separate the information with
spaces, calculate and output the average age of this group of people (keep 2
decimal places) and the number of males among them.).
3:Use string indexing and slicing knowledge to input month numbers and output
English month abbreviations(This is a programming question. Please write the
question description here. For example: This question requires you to input an
integer from 1 to 12 and output the abbreviation of the corresponding month name).
Tip: To find the greatest common divisor, you can use the Euclidean algorithm. The
least common multiple is the product of the two numbers divided by the greatest
common divisor.)
7:Sum the numeric elements of a list or tuple(Find the sum of numbers in a list,
the nesting level of the list is not limited to 2 levels
Input format:
Enter a list or tuple on one line
Output format:
Output the sum of numbers in one line)
Output format:
Output the encrypted ciphertext.)
Input two lines of strings, separated by spaces, and store each line of strings in
list form. Use the element values of the first list as keys and the elements of the
corresponding order in the second list as values to construct a dictionary. After
arranging the keys in ascending order, output a list of all key-value pairs in the
dictionary.
Input format:
First enter a positive integer T, which represents the number of test data groups,
followed by T groups of test data.
For each test group, enter a string containing uppercase and lowercase letters and
spaces (length not exceeding 85), and the words are composed of several letters,
separated by a space.
Output format:
For each test group, output the abbreviated result on a line, with a space between
words.
Enter an integer
Output format:
I learned the multiplication table in elementary school. Please use nested for loop
to output the multiplication table.
Input format:
No input
Output format:
Output all anti-primes less than n in order from small to large, with " " after
each number.
According to relevant regulations, children who are 6 years old before August 31 of
the year can register for primary school. Check whether the child is eligible for
registration in 2022 based on the ID number. (The eight digits starting from the
seventh are the date of birth)
Input format:
Input ID number
Output format: