I'd appreciate it if you could give me a hint for the practice question

Asked 2 years ago, Updated 2 years ago, 16 views

str_data={'A', 'B', 'C'}

joined_str="and".'Code (str_data)

print(joined_str)

Output value:

B and A and C

Shouldn't we say "reverse" to the "code"?

python

2022-09-20 10:27

1 Answers

Hello.

First of all, reverse is a function that reverses the order of array elements. str_data, i.e., the BAC shape will not appear even if you flip the BAC.

Since the output value is connected by "and" and the character is at the beginning of 'code', it seems that the intention of the problem is to use a function that pastes the element of the array as a single string. Just give them a hint as the title says.

But if you just stick it on, it will be in the form of "A and B and C". If you need to modify the 'code' part to derive the output value, I think the problem is a little wrong.


2022-09-20 10:27

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.