Предмет: Информатика, автор: oksanakostruba

скільки цілих чисел від 100 до 9999, в яких усі цифри різні. В мене в пайтоні вийшло 5184 . Чи вірно?

Ответы

Автор ответа: kostalomka88
1

Ответ:

Проверь так

Объяснение:

#Python

count = 0

for num in range(100, 10000):

# створюємо множину з цифр у числі

digits = set(str(num))

# якщо кількість унікальних цифр у числі співпадає з довжиною числа, значить усі цифри у числі унікальні

if len(digits) == len(str(num)):

count += 1

print(count)


oksanakostruba: По вашому виходить нуль.
Автор ответа: p15
1

Ответ:

print(sum(map(lambda x:len(str(x))==len(set(str(x))), range(100,10000))))

Объяснение:

5184

Похожие вопросы
Предмет: Химия, автор: m47782648
Предмет: Английский язык, автор: Yatoxxxxxx
1. Put the sentences into a negative (-) or an interrogative (?) form. 1. All the family go for a walk in the evenings. (?) 2. Jane plays the violin brilliantly. (-) 3. They are working on their project at the moment. (?) 4. The Jacksons stayed in a luxurious hotel. (-) 5. He had a little house in a village. (?)
2. . Choose the correct point. 1. ….. Tom and Bob good football players? a) am b) is c) are 2. They ……………….a new car. a) has got b) has c) have 3. …………… money do you have? a) How much b) How many c) How 4. My sister …………… two foreign languages. a) is speaking b) speaks c) speak 5. The seminar starts …. 10 o’clock. a) in b) at c) on 6. Go …… the blackboard, please! a) to b) at c) in 7. Diana …………… to the party tomorrow. a) comes b) is coming c) came 8. Mary ……….. tennis two days ago. a) played b) plays c) is playing 9. I’m glad he looks …………. today. a) happiest b) happyer c) happier 10. My flat ………. very modern. a) are b) is c) – 11. John ……….. his granny three times a week. a) visits b) is visiting c) visit 12. We ………… hard this week because of the exam. a) study b) are studying c) studies 13. My favourite side dish is mashed …………. . a) potato b) potatos c) potatoes 14. Her grandparents live in the country and have a lot of ………….. . a) sheep b) sheeps c) sheepes 15. ………… bag is it? Maria’s? a) who b) who’s c) whose 16. There is …………. to do here. I lie on the bed all day. a) something b) anything c) nothing 17. Ben doesn’t like very sweet tea. He usually puts ………… sugar in it. a) little b) few c) much 18. Would you like …………… to read on the train? a) something b) anything c) nothing 19. I wanted to talk to Sarah and sat down …………. her. a) far from b) next to c) below 20. It is my ………… time here. a) twelve b) twelveth c) twelfth 21. She is ………. player in the team. a) the strongest b) a stronger c) strong 22. She is as …………. in Maths as her sister. a) better b) best c) good 23. He can’t talk to you now. He ………….. a shower. a) is takeing b) is taking c) taking 24. I ………… you now even more than before. a) am loving b) love c) loving 25. George arrived in Moscow ……… . a) two days ago b) in two days c) today 26. We ……….. a dictation yesterday. a) didn’t wrote b) didn’t write c) don’t write 27. There ………...... a lot of milk in the fridge. a) are b) – c) is 28. There ………. six desks in the classroom. a) are b) some c) is 29. My brother ………… near our house. a) don’t live b) doesn’t lives c) doesn’t live 30. I’d like to ………… karate. a) go b) do c) play ,
Предмет: Математика, автор: np356513