Editing 0942 - Cifre 23

Revision as of 11:43, 1 April 2023 by Pop Giulia (talk | contribs) (Pagină nouă: n = input("Introduceți numărul: ") numar_aparitii = [0, 0] # lista care va contoriza de cate ori apare cifra 2 si cifra 3 # parcurgem cifrele numarului si contorizam for cifra in n: if cifra == '2': numar_aparitii[0] += 1 elif cifra == '3': numar_aparitii[1] += 1 # determinam cifra care apare de cele mai multe ori if numar_aparitii[0] > numar_aparitii[1]: print("2") elif numar_aparitii[1] > numar_aparitii[0]: print("3") else: print("2 3"))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Warning: You are editing an out-of-date revision of this page. If you publish it, any changes made since this revision will be lost.
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
Please note that all contributions to Bitnami MediaWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Bitnami MediaWiki:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)