21 Mart 2010, Pazar
'eşdeğer && bir deyim s Python
İşte benim kod:
# F. front_back
# Consider dividing a string into two halves.
# If the length is even, the front and back halves are the same length.
# If the length is odd, we'll say that the extra char goes in the front half.
# e.g. 'abcde', the front half is 'abc', the back half 'de'.
# Given 2 strings, a and b, return a string of the form
# a-front b-front a-back b-back
def front_back(a, b):
# your code here
if len(a) % 2 == 0 && len(b) % 2 == 0:
return a[:(len(a)/2)] b[:(len(b)/2)] a[(len(a)/2):] b[(len(b)/2):]
else:
#todo! Not yet done. :P
return
Koşullu EĞER bir hata alıyorum. Neyi yanlış yapıyorum?
CEVAP
21 Mart 2010, Pazar
and
&&
yerine isterim.
Bunu Paylaş:
Java Python Sözlükler Eşdeğer...
node.js eşdeğer python's __adı== ...
Php eşdeğer'In print_r() python?...
Javascript'In Python eşdeğer zip ...
Python ilk madde veya Yok dönmek deyim...