如何通过替换连续变量从另一个列表创建一个列表?

时间:2019-07-08 07:43:32

标签: python list jupyter-notebook

我的列表为:

    @Bean
fun userConsumerConfigs(): Map<String, Any> {
    val props = HashMap<String, Any>()
    props[ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG] = "$host:$port"
    props[ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG] = StringDeserializer::class.java
    props[ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG] = JsonDeserializer::class.java
    props[ConsumerConfig.GROUP_ID_CONFIG] = "helloworld"

    return props
}

@Bean
fun userConsumerFactory(): ConsumerFactory<String, EmailSent> {
    return DefaultKafkaConsumerFactory(userConsumerConfigs(), StringDeserializer(), JsonDeserializer<>(EmailSent::class))
}

我要删除所有连续变量。

我期望的输出是:

l=["a","a","a","a","d","a","d","d"]

0 个答案:

没有答案