Hướng dẫn which of the following is not a valid string method in python? - phương thức nào sau đây không phải là phương thức chuỗi hợp lệ trong python?

Permalink

Không thể lấy lại những người đóng góp tại thời điểm này

Tệp này chứa văn bản unicode hai chiều có thể được giải thích hoặc biên dịch khác với những gì xuất hiện dưới đây. Để xem xét, hãy mở tệp trong một trình soạn thảo cho thấy các ký tự Unicode ẩn. Tìm hiểu thêm về các ký tự unicode hai chiều

Question1 1
Những gì does the following Python Program print out?
str1="Hello" = "Hello"
str2='there' = 'there'
bob=str1+str2 = str1 + str2
In (Bob)(bob)
Xin chào
Xin chào
0
Xin chào
Xin chào
ở đó: Hellothere
Question2 2
Trả lời: Hellothere does the following Python program print out?
x='40' = '40'
Những gì = int(x) + 2
y = int (x) +2(y)
42
x2
402
int402
in (y): 42
Question3 3
Trả lời: 42 would you use the index operator [] to print out the letter q from the following string?
Howwouldyouusetheindexoperator [] Toprintouttheletterqfromthefollowlablestring? = 'From '
x = 'từ'(x[9])
in (x [9])(x[q])
in (x [q])(x[-1])
in (x [-1])(x[7])
in (x [7])(x[8])
in (x [8]): print(x[8])
Question4 4
Trả lời: In (x [8]) would you use string slicing [:] to print out 'uct' from the following string?
Howwouldyouusetheindexoperator [] Toprintouttheletterqfromthefollowlablestring? = 'From '
x = 'từ'(x[14:3])
in (x [9])(x[14+17])
in (x [q])(x[15:18])
in (x [-1])(x[14:17])
in (x [7])(x[14/17])
in (x [8])(x[15:3])
Trả lời: In (x [8]): print(x[14:17])
Question5 5
Howwouldyouusestringsling [:] Toprintout'fuct'fromthefollowingsTring? is the iteration variable in the following Python code?
in (x [14: 3]) letter in 'banana' :
in (x [14+17])(letter)
for
in (x [15:18])
in (x [14:17])
in (x [14/17])banana'
in
in (x [15: 3]): letter
Question6 6
Trả lời: In (X [14:17]) does the following Python code print out?
WhatistheiterationvarableInthefollowingPythoncode?(len('banana')*7)
-11
Forletterin'banana ': banana banana banana banana banana banana
0
42
in (y): 42
Trả lời: 42 would you print out the following variable in all upper case in Python?
Howwouldyouusetheindexoperator [] Toprintouttheletterqfromthefollowlablestring? = 'Hello Bob'
x = 'từ' greet.ucase;
in (x [9]).log(greet.toUpperCase());
in (x [q])(uc($greet);)
in (x [-1])(greet.upper())
in (x [7]): print(greet.upper())
Question8 8
in (x [8]) of the following is not a valid string method in Python?
Trả lời: In (x [8])()
Howwouldyouusestringsling [:] Toprintout'fuct'fromthefollowingsTring?()
in (x [14: 3])()
in (x [14+17])()
in (x [15:18]): twist
Question9 9
in (x [14:17]) will the following Python code print out?
in (x [14/17]) = 'From stephen. Sat Jan 5 09:14:16 2008'
in (x [15: 3]) = data.find('.')
Trả lời: In (X [14:17])(data[pos:pos+3])
.mama
WhatistheiterationvarableInthefollowingPythoncode?
Forletterin'banana ':
09:14:14
In (Thư): .ma
Question10 10
bức thư of the following string methods removes whitespace from both the beginning and end of a string?
in()
'trái chuối'()
Trả lời: Thư()
WhatDoesTefollowingPythonCodeprintout?()
in (Len ('chuối')*7): strip()

Chủ đề