wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Đề Cương Học Kì 2 - Khối 10

Total questions: 87

Worksheet time: 1hrs 14mins

Name
Class
Date
1.

Trong Python, có bao nhiêu loại cấu trúc vòng lặp?

a)

1.

b)

2.

c)

3.

d)

4.

2.

Đâu là câu trả lời đúng trong chương trình sau? x=0 for i in range(10): x=x+1 print(x)

a)

Chương trình in các số nguyên từ: 0 đến 10.

b)

Chương trình in các số nguyên từ: 0 đến 9.

c)

Chương trình in các số nguyên từ: 1 đến 10.

d)

Chương trình in các số nguyên từ: 1 đến 9.

3.

Cú pháp của vòng lặp for được cấu trúc như sau: for i in range(n) trong đó n là một số nguyên dương, vòng lặp này được thực hiện bao nhiêu lần?

a)

n+1 lần.

b)

n-1 lần.

c)

không thể xác định.

d)

n lần.

4.

Xem xét đoạn chương trình sau: sodem=1 while sodem<5: print(sodem,end="") sodem=sodem+1 Sau khi thực thi đoạn chương trình trên, giá trị của 'sodem' là bao nhiêu?

a)

1234.

b)

12345.

c)

4321.

d)

1.

5.

Điền vào chỗ trống (...) để tìm số lớn nhất trong 3 số đầu vào: def find_max(a, b, c): max = a if (...): max = b if (...): max = c return max

a)

max < b, max < c.

b)

max <= b, max < c.

c)

max < b, max <= c.

d)

max <= b, max <= c.

6.

Xem xét hai đoạn chương trình dưới đây, câu nào là đúng?

a)

(a,b,c) là tham số, (x,y) là đối số.

b)

(a,b,c) là đối số, (x,y) là tham số.

c)

(a,b,c) và (x,y) đều là đối số.

d)

(a,b,c) và (x,y) đều là tham số.

7.

Trong số các phát biểu sau, phát biểu nào là sai?

a)

Các biến được khai báo bên trong một hàm có thể được sử dụng bởi chương trình chính.

b)

Các biến được khai báo bên ngoài một hàm chỉ có thể truy cập giá trị của chúng bên trong hàm mà không thay đổi (trừ trường hợp sử dụng từ khóa global).

c)

Trong Python, tất cả các biến được khai báo bên trong một hàm đều là biến cục bộ và không có tác động bên ngoài hàm.

d)

Các biến được khai báo bên trong một hàm chỉ có thể được sử dụng trong hàm đó. Chương trình chính không thể sử dụng chúng.

8.

Kết quả của chương trình sau là gì: def my_function(x): return 3 * x print(my_function(3)) print(my_function(5)) print(my_function(9))

a)

3, 5, 9.

b)

9, 15,

9.

Kết quả của chương trình sau là gì: def my_function(x): return 3 * x print(my_function(3)) print(my_function(5)) print(my_function(9))

a)

3, 5, 9.

b)

9, 15, 27.

c)

9, 5, 27.

d)

Chương trình có lỗi.

10.

Chức năng của hàm sau là gì? def sum(a, b): print("sum = " + str(a + b))

a)

Trả về tổng của hai số a và b được truyền vào.

b)

Trả về hai giá trị a và b.

c)

Tính tổng của hai số a và b.

d)

Tính tổng của hai số a và b và hiển thị nó trên màn hình.

11.

Để biết độ dài của chuỗi s, hàm nào nên được sử dụng?

a)

str(s)

b)

len(s)

c)

length(s)

d)

s.len()

12.

Cho hai chuỗi s1='ab', s2='a' với cú pháp: s2 in s1, kết quả sẽ là gì?

a)

đúng

b)

Đúng

c)

sai

d)

False

13.

Đối với chuỗi s = "Python"; giá trị của len(s) và s[1] là gì?

a)

6 và 'P'

b)

6 và 'y'

c)

5 và 'y'

d)

5 và 'P'

14.

Để truy cập phần tử đầu tiên của một danh sách trong Python, chỉ số nào nên được sử dụng?

a)

0

b)

1

c)

2

d)

-1

15.

Trong Python, lệnh nào được sử dụng để thêm một phần tử vào cuối danh sách?

a)

add()

b)

insert()

c)

append()

d)

extend()

16.

Trong Python, lệnh nào được sử dụng để chèn một phần tử vào một vị trí cụ thể trong danh sách?

a)

add()

b)

insert()

c)

append()

d)

extend()

17.

Để khai báo một danh sách rỗng Z, khai báo nào là đúng?

a)

Z=[ ]

b)

Z=""

c)

Z=( ).

d)

Z=0

18.

Chọn tùy chọn đúng cho kết quả của chương trình sau:

a)

0 1 2

b)

traicay

c)

1 2 3.

d)

xoài cốc ổi.

19.

Giả sử A = [5, 6, 7, 8, 9, 10, 11, 12]. Biểu thức sau có trả về true hay false không? (3 + 4 - 5 + 18 // 4) trong A

a)

Đúng.

b)

Sai.

c)

Không xác định.

d)

Câu lệnh có lỗi.

20.

Which statement is correct?

a)

After executing the clear() command, the elements return a value of 0.

b)

The remove command returns False if not in the list.

c)

remove() has the effect of deleting an element with a given value in the list.

d)

The remove() command has the effect of deleting an element at a given position.

21.

Chọn tùy chọn đúng cho chương trình sau:

a)

[1, 2, 3, 4, 5, 6, 6, 5]

b)

[1, 2, 3, 4]

c)

[6, 5]

d)

[1, 2, 3, 4, 5, 6].

22.

Chọn tùy chọn đúng cho chương trình sau:

a)

[1, 2, 3, 4, 5, 6, 6, 5]

b)

[1, 2, 3, 4]

c)

[6, 5]

d)

[1, 2, 3, 4, 5, 6]

23.

Chọn câu không đúng từ các câu sau:

a)

Các lỗi trong chương trình Python có thể được phân loại thành ba loại.

b)

Khi có lỗi cú pháp, chương trình sẽ dừng ngay lập tức và báo lỗi.

c)

Các lỗi thời gian chạy là những lỗi không thể thực thi một lệnh trong chương trình.

d)

Cách xử lý các loại lỗi khác nhau là như nhau.

24.

Trong số các phát biểu sau, phát biểu nào là đúng?

a)

Hàm float() trả về một số nguyên từ một biểu thức số hoặc chuỗi.

b)

Có một số hàm tích hợp sẵn trong Python.

c)

Hàm bool() chuyển đổi một giá trị thành Boolean.

d)

Hàm input() có thể nhập một số nguyên mà không cần chuyển đổi kiểu.

25.

Câu nào sau đây là sai?

a)

Bạn có thể truy cập từng ký tự của một chuỗi thông qua chỉ số.

b)

Chỉ số bắt đầu từ 0.

c)

Bạn có thể thay đổi từng ký tự của một chuỗi.

d)

Python không có kiểu dữ liệu ký tự.

26.

Kết quả của chương trình sau đây là gì?

a)

5.

b)

10.

c)

Chương trình có lỗi.

d)

50.

27.

Giả sử A = [5, 6, 7, 8, 9, 10, 11, 12]. Biểu thức sau có trả về true hay false không? (3 + 4 - 5 + 18 // 4) trong A

a)

Đúng.

b)

Sai.

c)

Không xác định.

d)

Câu lệnh có lỗi.

28.

Kết quả của chương trình sau đây là gì?

a)

1 2 3 4 5 6

b)

1 2 3 4 5 6 5

c)

1 2 3 4 5

d)

2 3 4 5 6 5.

29.

Giả sử A = ['a', 'b', 'c', 'd', 2, 3, 4]. Các biểu thức sau có trả về true hay false không? 6 in A, 'a' in A

a)

Đúng, Sai.

b)

Đúng, Sai.

c)

Sai, Đúng.

d)

Sai, Sai.

30.

Trong Python, lệnh nào truy cập phần tử 'a' trong danh sách X=[1, 5, -12, 'a', 'kf']?

a)

X[3]

b)

X=[5]

c)

X[4]

d)

X=[6]

31.

Giả sử A=[1,2,3,4]. Kết quả của câu lệnh 4 có trong A là gì?

a)

Đúng

b)

Sai

c)

đúng

d)

Sai

32.

Chuỗi trong Python là gì?

a)

Chuỗi là một dãy các ký tự Unicode.

b)

Một dãy các số.

c)

Bất kỳ số nào tùy ý.

d)

Bất kỳ giá trị nào tùy ý.

33.

Ý nghĩa của hàm len là gì?

4 lines
34.

Trong Python, chuỗi là gì?

a)

Một chuỗi là một dãy các ký tự Unicode

b)

Một dãy các số

c)

Bất kỳ số nào tùy ý

d)

Bất kỳ giá trị nào tùy ý

35.

Có nghĩa của hàm len là gì?

a)

Chuyển đổi một chuỗi thành chữ hoa

b)

Trả về độ dài của chuỗi

c)

Sao chép một chuỗi

d)

Xóa một ký tự trong chuỗi

36.

Trong Python, từ khóa nào được sử dụng để định nghĩa một hàm?

a)

func

b)

def

c)

abs

d)

len

37.

Khi gọi một hàm, dữ liệu được truyền vào hàm được gọi là gì?

a)

Đối số.

b)

Tham số.

c)

Hệ số.

d)

Số hàm.

38.

Để tái sử dụng một biến toàn cục như một biến cục bộ, từ khóa nào được sử dụng để khai báo nó?

a)

def

b)

int

c)

global

d)

local

39.

Câu nào sau đây là sai về phạm vi của các biến trong Python?

a)

Một biến được khai báo bên trong một hàm chỉ có hiệu lực trong hàm đó và không ở bên ngoài.

b)

Một biến được khai báo bên ngoài một hàm sẽ không có hiệu lực bên trong hàm như một biến.

c)

Một biến được khai báo bên ngoài sẽ cần được khai báo lại bên trong hàm với từ khóa global để có hiệu lực bên trong.

d)

Một biến trong Python, khi đã được khai báo, sẽ có hiệu lực trong tất cả các hàm và bên ngoài.

40.

Có bao nhiêu loại lỗi trong các chương trình Python?

a)

2

b)

3

c)

4

d)

5

41.

Giả sử chương trình có lệnh nhập sau: n = int(input("Nhập một số nguyên n: ")) Ngoại lệ nào xảy ra khi nhập 1.5?

a)

Cú pháp lỗi

b)

Lỗi kiểu

c)

Lỗi giá trị

d)

Lỗi chỉ số

42.

Mục đích của việc kiểm tra một chương trình là gì?

a)

Để tự động sửa lỗi chương trình

b)

Để tìm lỗi trong chương trình

c)

Để tìm lỗi và tự động sửa lỗi chương trình

d)

Để tìm lỗi và ngăn chặn các lỗi trong tương lai xảy ra

43.

Dựa trên kiến thức về hàm trong Python, xác định xem các câu sau đây là đúng hay sai: Hàm Tham số Ý nghĩa float(x) x có thể là một số hoặc một chuỗi Chuyển đổi x thành một số thập phân str(x) x có thể là một số hoặc một chuỗi Chuyển đổi x thành một chuỗi len(x) x là một danh sách hoặc một chuỗi Độ dài của đối tượng x list(x) x là một chuỗi hoặc hàm ngang Chuyển đổi x thành một danh sách

a)

Đúng

b)

Sai

44.

Câu lệnh float("3.14") sẽ trả về giá trị gì?

a)

Số thập phân 3.14

b)

Chuỗi "3.14"

c)

Độ dài của đối tượng x

d)

Danh sách ['hello']

45.

Xác định xem các phát biểu sau có đúng hay sai dựa trên kiến thức của bạn về một số hàm trong Python.

a)

Biểu thức abs(-5) sẽ trả về giá trị 5.

b)

Biểu thức bool(0) sẽ trả về giá trị True.

c)

Biểu thức ord('A') sẽ trả về giá trị 65.

d)

Biểu thức chr(97) sẽ trả về ký tự 'B'.

46.

Cho ví dụ: >>>def func_tong(a,b,c): return a+b+c >>>m,n=12,9 >>>func_tong(15,m,n), tên của hàm là gì?

a)

func_tong

b)

a, b, c là các tham số

c)

Cú pháp gọi hàm là func_tong(a,b,c):

d)

Các tham số của chương trình là 15, m, n

47.

Cho chương trình: #exponent def luythua(a,n): return a**n a = int(input('Nhập cơ số:')) n = int(input('Nhập số mũ:')) print(a, 'lên', n, '=', luythua(a,n)), tên của hàm là gì?

a)

luythua

b)

Trong câu lệnh def luythua(a,n): a, n là tham số

c)

Trong câu lệnh print(a, 'lên', n, '=', luythua(a,n)) a, n là đối số

d)

Câu gọi hàm là def luythua(a,n):

48.

Cho chương trình: # Tính giai thừa; def giaithua(n): gt=1; for i in range(1, n+1): gt *= i; return gt; n = int(input('Nhập số để tính giai thừa:')); print(n, 'giai thừa =', giaithua(n)); tham số trong câu lệnh def giaithua(n): là gì?

a)

n là một tham số

b)

Chương trình khai báo 2 tham số

c)

Trong câu lệnh print(n, 'giai thừa =', giaithua(n)); n là một đối số

d)

Các tham số được viết trong dấu ngoặc đơn ngay sau tên hàm

49.

Cho chương trình: #COMBINATION; def gt(n): kq=1; for i in range(1,n+1): kq=kq*i; return kq; def c(n,k): return gt(n)/(gt(k)*gt(n-k)); print('CHƯƠNG TRÌNH TÍNH TOÁN N KẾT HỢP K:'); n=int(input('Nhập n = ')); k=int(input('Nhập k = ')); print('C(',n,',',k,') = ' , c(n,k)); tham số trong câu lệnh def gt(n): là gì?

a)

n là một đối số

b)

Chương trình khai báo các tham số

50.

Trong câu lệnh def gt(n):, n là một tham số.

a)

[TH] Đúng

b)

[TH] Chương trình khai báo các tham số n, k

c)

[TH] Trong câu lệnh print(…, c(n,k));, n, k là các tham số

d)

[TH] Trong câu lệnh return gt(n)/…;, n là một tham số

51.

The first 10 Fibonacci numbers of the sequence.

a)

[TH] The function name is fibonacci(n) with parameter n

b)

[TH] In the statement sb = sb + str(fibonacci(i)) + ' ';, i is an argument

c)

[TH] fibonacci(n - 1), fibonacci(n - 2) are parameters of the program

d)

[TH] In the statement return n;, n is an argument

52.

Finding the greatest common divisor (GCD).

a)

[TH] In the statement def uscln(a, b):, the function uscln(a, b) has arguments a, b

b)

[TH] If we call uscln(m, n):, the program will report an error

c)

[TH] The function uscln(a, b) finds the greatest common divisor of a and b

d)

[TH] If we call uscln(9, 12):, the program will yield the result of 9

53.

Finding the greatest common divisor (GCD) and the least common multiple (LCM).

a)

[TH] The parameters of the program are a, b

b)

[TH] If we call bscnn(x, y), the program will return the result x

c)

[TH] If we call bscnn(9, 6, 3), the program will return the result 9

d)

[TH] In the statement return int(…/ uscln(a, b));, a, b are arguments

54.

Power calculation.

a)

[TH] The variables a, n are local variables

b)

[TH] When entering a=2, b=3, the result printed is 6

c)

[TH] The variables a, n are effective in the function def luythua(a,n) and are effective globally

55.

Question 11: Given the program segment: >>>def Ham(x,y): z=15 x=x*3 y=x+y return x+y+z >>>x=5 >>>y=6 >>>Ham(x,y) 51 >>>z What can be said about the variables x, y, z?

a)

In the program segment, the variables x, y, z are local variables.

b)

In the segment >>>x=5 >>>y=6, x, y are external variables. After running the function, the values of x, y do not change.

c)

The result 51 is not the result of the command return x+y+z.

d)

When executing the command >>>z, the result is 26.

56.

Question 12: Given the commands: >>>m,n=3,5 >>>def a(m,n): m=m+n n=n*m return m+n What can be said about the variables m, n?

a)

After executing the command a(7,10), the values of m=3 and n=5.

b)

In the function, two variables m, n are declared with the same names as the two variables m, n declared outside the function.

c)

The variables m, n are local variables of the program.

d)

It is not allowed to declare m,n=3,5 but must declare m=3 and n=5 separately.

57.

Question 13: Given the commands: >>>def f(a,b): m=5*(a+b) print(m+n) >>>n=20 >>>f(1,2) What can be said about the variables m, n, a, b?

a)

The variables m, n, a, b are local variables of the program.

b)

The variable n is both a variable of the function and not a variable of the main program.

c)

The result of the program is 35.

d)

The values 1, 2 are local variables of the program.

58.

Question 14: Given the program: # Calculate n factorial; def giaithua(n): gt=1; for i in range(1, n+1): gt *= i; return gt; n = int(input('Enter the number to calculate factorial:')); print(n, 'factorial =', giaithua(n)); What can be said about the variables gt, n, i?

a)

The variables gt, n, i are local variables.

b)

The variables gt, n, i are variables that have effects throughout the program.

c)

If we enter n=5, the result of the program is 25.

d)

In the above program, the variable gt is initially assigned the value of 1.

59.

Question 15: Given the program: #COMBINATION; def gt(n): kq=1; for i in range(1,n+1): kq=kq*i; return kq; def c(n,k): return gt(n)/(gt(k)*gt(n-k));

4 lines
60.

Given the program below: #COMBINATION; def gt(n): kq=1; for i in range(1,n+1): kq=kq*i; return kq; def c(n,k): return gt(n)/(gt(k)*gt(n-k)); print('PROGRAM TO CALCULATE N COMBINATION K:'); n=int(input('Enter n = ')); k=int(input('Enter k = ')); print('C(',n,',',k,') = ' , c(n,k));

a)

The variables kq, i, n, k are local variables

b)

The variables kq, i, n, k are global variables

c)

If we enter n=10, k=2 then the result of the program is 10

d)

In the above program, it is not allowed to enter data for the variables n=k

61.

Given the program below: # The first 10 Fibonacci numbers of the sequence def fibonacci(n): if (n < 0): return -1; elif (n == 0 or n == 1): return n; else: return fibonacci(n - 1) + fibonacci(n - 2); print('The first 10 numbers of the Fibonacci sequence: '); sb = ''; for i in range(0, 10): sb = sb + str(fibonacci(i)) + ' '; print(sb)

a)

The variable n is a local variable

b)

The variables n, i, sb are local variables

c)

If we enter n=50 then the result of the program is 100

d)

The variable n is a global variable

62.

Given the program below: # Find the greatest common divisor (GCD) def uscln(a, b): if (b == 0): return a; return uscln(b, a % b);

a)

The variables a, b are local variables

b)

The variables a, b cannot have the same value a=b

c)

If we enter a=50 and b=30 then the result of the program is 50

d)

The variables a, b are global variables

63.

Given the program below: # Find the greatest common divisor (GCD) def uscln(a, b): if (b == 0): return a; return uscln(b, a % b); # Find the least common multiple (LCM) def bscnn(a, b): return int((a * b) / uscln(a, b));

a)

The variables a, b are local variables

b)

The variables a, b cannot have the same value a=b

c)

If we enter a=50 and b=30 then the result of the program bscnn(a, b) is 30

d)

The variables a, b are global variables

64.

Given the command below: >>>n=int(input('Enter number n=')) n=25,8

a)

The program reports a SyntaxError: invalid syntax

b)

The program reports a Traceback (most recent call last): File 'pyshell#0, line 1, in n

65.

The program reports a SyntaxError: invalid syntax.

a)

The program reports a SyntaxError: invalid syntax.

b)

The program reports a Traceback (most recent call last): File "pyshell#0, line 1, in n=int(input(" Nhập số nguyên n=")) valueError: invalid literal for int() with base 10: '25,8'

c)

To fix the program's error, we can change n=int(input(" Nhập số n=")) to n=float(input(" Nhập số n="))

d)

To fix the program's error, we can change the input n to any integer value.

66.

The program sorts the array into descending order. The initial array is [6, 9, 1, 4, 7, 0, 5], the result obtained is [1, 4, 5, 6, 7, 9, 0].

a)

The program may have a semantic error because it produces the wrong result.

b)

The program may have a logic error inside because it produces the wrong result.

c)

The program has a syntax error SyntaxError: invalid syntax.

d)

To produce the correct result, the initial array [6, 9, 1, 4, 7, 0, 5] must be rewritten as ["6, 9, 1, 4, 7, 0, 5"]

67.

The program sorts the array into ascending order. The initial array is [8, 3, 0, 9, 12, 1, 15], the result obtained is [1, 3, 8, 9, 12, 15, 0].

a)

The program may have a semantic error because it produces the wrong result.

b)

The program may have a logic error inside because it produces the wrong result.

c)

The program has a syntax error SyntaxError: invalid syntax.

d)

To produce the correct result, the initial array [8, 3, 0, 9, 12, 1, 15] must be rewritten as ["8, 3, 0, 9, 12, 1, 15"]

68.

The program needs to be tested with a number of datasets consisting of typical inputs depending on the specific characteristics of the problem and the results of the outputs that are known in advance. Problems may have inputs according to different criteria such as size and diversity of data.

a)

The program only needs 1 test case, no need for multiple test cases according to different criteria such as size and diversity of data.

b)

The program needs to have random test cases.

c)

The program needs to have test cases for edge data.

d)

Simple programs do not need any test cases.

69.

Given the program: a = input("Enter number a: ") b = input("Enter number b: ") print("The sum of the two entered numbers

4 lines
70.

For the program: a = input("Enter number a: ") b = input("Enter number b: ") print("The sum of the two entered numbers is: ", a+b), which of the following statements is true?

a)

The program does not generate an error

b)

If a=50 and b=5, the result of the program is 55

c)

The first two lines can be changed as follows: a=int(input("Enter number a: ")) b=int(input("Enter number b: "))

d)

The first two lines can be changed as follows: a=float(input("Enter number a: ")) b=float(input("Enter number b: "))

71.

For the sorting program of the number array: M=[7, 21, 0, 6, 9, 23, 18] for i in range(len(M)-1): j=i while j>1 and M[j] < M[j-1]: M[j],M[j-1]= M[j-1], M[j] J=j-1 print(M), which of the following statements is true?

a)

Line 1 has an error

b)

Line 2 has an error

c)

Line 4 has an error

d)

Line 7 has an error

72.

Let GCD(a, b) be the GCD function of two natural numbers a, b. It is clear that GCD(a,b)=GCD(b, a%b) if b>0 and GCD(a,0)=a. Write a program to input two numbers a, b and calculate the GCD of a, b.

a)

The program is written as follows: def uscln(a, b): if (b == 0): return a; return uscln(b, a % b); a = int(input("Enter positive integer a: ")); b = int(input("Enter positive integer b: ")); print("The greatest common divisor of", a, "and", b, "is:", uscln(a, b));

b)

The program is written as follows: def UCLN(a,b): r = a % b while r != 0: a = b b = r r = a % b return b

c)

The program is written as follows: def luythua(a,n): return a**n a = int(input('Enter base:')) n = int(input('Enter exponent:')) print(a, 'to the power of', n, '=', luythua(a,n))

d)

The program is written as follows: def UCLN(a,b): r = a % b while r != 0: a = b b = r r = a % b return b a=int(input("Enter the first natural number")) b=int(input("Enter the second natural number")) print("The GCD of a and b is: ",UCLN(a,b))

73.

The program inputs a positive odd real number a from the keyboard. The program needs to check the input data as follows: If the entered number is negative, or equal to 0, or even, then notify: "The entered number is incorrect, number a must be greater than 0 and odd. Please enter again!" The program only stops when the user enters correctly.

4 lines
74.

Enter a positive odd number: The number must be greater than 0 and odd. Please enter again!

a)

Enter a positive integer:

b)

Enter a positive float:

c)

Enter a positive float:

d)

Enter a:

75.

Enter a positive integer a which is one side of a square. Print the area and perimeter of it.

a)

Enter a side of the square:

b)

Enter a positive float:

c)

Enter a side of the square:

d)

Enter a side of the square:

76.

Enter two positive integers a and b which are two sides of a rectangle. Print the area and perimeter of it.

a)

Enter length:

b)

Enter width:

77.

Calculate the area and perimeter of a rectangle.

a)

Enter length:

b)

Enter width:

c)

Area of the rectangle is:

d)

Perimeter of the rectangle is:

78.

Find all combinations to get 1700đ from 500đ, 200đ, and 100đ notes.

a)

500 notes:

b)

200 notes:

c)

100 notes:

79.

How many chickens and dogs are there if there are 36 animals and 100 legs?

a)

Number of chickens:

b)

Number of dogs:

80.

Write a function h.

4 lines
81.

Write a function that takes multiple numbers (integers or floats) from the keyboard, separated by spaces. Transfer these numbers into list A and print list B consisting of the even numbers from list A, calculate the sum and count of those even numbers.

4 lines
82.

Write a program that requires input from the keyboard for a string of characters, then reports: The total number of characters that are digits in the string. The total number of characters that are English letters in the string. Write a function for each of the above requirements.

4 lines
83.

Using a function, write a program that performs: Input two natural numbers from the keyboard, separated by spaces. Calculate and print the sum of these numbers. Input two natural numbers from the keyboard, separated by commas, print the greatest common divisor of the two numbers.

4 lines
84.

Given the list A=[3, 2, 12, -34, 31, 7, -2]. Create list B consisting of even numbers, and list C consisting of odd numbers. Calculate the sum of even numbers, odd numbers, and how many even and odd numbers there are.

4 lines
85.

Write a function that takes a full name (including last name, middle name, and first name) from the keyboard. Then print out the last name, middle name, and first name in order. For example: Enter full name: Nguyen Hong Kim Hoa Last name: Nguyen Middle name: Hong Kim First name: Hoa

4 lines
86.

Write a function that takes n integers from the keyboard, separated by spaces. Then print out: - The list of numbers entered on one line - The largest number and the index of the largest number. - The smallest number and the index of the smallest number.

4 lines
87.

Write a program that performs the following tasks, each task needs to be performed by a function: - Input a sequence of integers from the keyboard, each number separated by spaces. Transfer these numbers into list A and print list A to the screen. - Extract from list A a list B consisting of even numbers. - Extract from list A a list C consisting of odd numbers.

4 lines