私は擬似コードで何をするべきかについて、コーディングとヒットには新しいです。 私はそのための最初の重複関数を定義しています= [1 2 2 3 4 4]それは2を返し、順序付きリストの最初の重複要素の検索
def firstDuplicate(a):
# put first element into new list (blist)
# check second element to blist
# if same, return element and end
# else, try next blist element
# if no next element, add to end of blist
# do the same with third element (counter) and so on until end of list
alist = list(a)
blist = list(a[1])
bleh = 1
comp = 2
if list(a[comp]) == blist[bleh]:
return list(a[comp]) # and end
if else bleh = bleh+1 # and repeat til last blist element
# to stop?
else blist = blist+list(a[2]) # append outside of blist?
これは私がこれまで行ってきたものです。私の次の提案は何ですか?
に興味がある場合は、このウェブサイトですPythonのキャリア構築ではない – bigbounty
@bigbounty何ですか? –
[OK]を、http://python-guide-pt-br.readthedocs.io/en/latest/ – bigbounty