python to php converter online
def MissingDigit(strParam):
#
# Split the expression to
# extract operands, operator
# and resultant
exp = list(strParam.split())
first_operand = exp[0]
operator = exp[1]
second_operand = exp[2]
resultant = exp[-1]
# If x is present in resultant
if 'x' in resultant:
x = resultant
first_operand = int(first_operand)
second_operand = int(second_operand)
if operator == '+':
res = first_operand + second_operand
elif operator == '-':
res = first_operand - second_operand
elif operator == '*':
res = first_operand * second_operand
else:
res = first_operand // second_operand
# If x in present in operands
else:
resultant = int(resultant)
# If x in the first operand
if 'x' in first_operand:
x = first_operand
second_operand = int(second_operand)
if operator == '+':
res = resultant - second_operand
elif operator == '-':
res = resultant + second_operand
elif operator == '*':
res = resultant // second_operand
else:
res = resultant * second_operand
# If x is in the second operand
else:
x = second_operand
first_operand = int(first_operand)
if operator == '+':
res = resultant-first_operand
elif operator == '-':
res = first_operand - resultant
elif operator == '*':
res = resultant // first_operand
else:
res = first_operand // resultant
res = str(res)
k = 0
for i in x:
if i == 'x':
result = res[k]
break
else:
k = k + 1
return result
# keep this function call here
print MissingDigit(raw_input())
python to php converter online
>>> mylist = [1, 2, 3]
>>> for i in mylist:
... print(i)
1
2
3
python to php converter online
def MissingDigit(strParam):
#
# Split the expression to
# extract operands, operator
# and resultant
exp = list(strParam.split())
first_operand = exp[0]
operator = exp[1]
second_operand = exp[2]
resultant = exp[-1]
# If x is present in resultant
if 'x' in resultant:
x = resultant
first_operand = int(first_operand)
second_operand = int(second_operand)
if operator == '+':
res = first_operand + second_operand
elif operator == '-':
res = first_operand - second_operand
elif operator == '*':
res = first_operand * second_operand
else:
res = first_operand // second_operand
# If x in present in operands
else:
resultant = int(resultant)
# If x in the first operand
if 'x' in first_operand:
x = first_operand
second_operand = int(second_operand)
if operator == '+':
res = resultant - second_operand
elif operator == '-':
res = resultant + second_operand
elif operator == '*':
res = resultant // second_operand
else:
res = resultant * second_operand
# If x is in the second operand
else:
x = second_operand
first_operand = int(first_operand)
if operator == '+':
res = resultant-first_operand
elif operator == '-':
res = first_operand - resultant
elif operator == '*':
res = resultant // first_operand
else:
res = first_operand // resultant
res = str(res)
k = 0
for i in x:
if i == 'x':
result = res[k]
break
else:
k = k + 1
return result
# keep this function call here
print MissingDigit(raw_input())
python to php converter online
def MissingDigit(strParam):
#
# Split the expression to
# extract operands, operator
# and resultant
exp = list(strParam.split())
first_operand = exp[0]
operator = exp[1]
second_operand = exp[2]
resultant = exp[-1]
# If x is present in resultant
if 'x' in resultant:
x = resultant
first_operand = int(first_operand)
second_operand = int(second_operand)
if operator == '+':
res = first_operand + second_operand
elif operator == '-':
res = first_operand - second_operand
elif operator == '*':
res = first_operand * second_operand
else:
res = first_operand // second_operand
# If x in present in operands
else:
resultant = int(resultant)
# If x in the first operand
if 'x' in first_operand:
x = first_operand
second_operand = int(second_operand)
if operator == '+':
res = resultant - second_operand
elif operator == '-':
res = resultant + second_operand
elif operator == '*':
res = resultant // second_operand
else:
res = resultant * second_operand
# If x is in the second operand
else:
x = second_operand
first_operand = int(first_operand)
if operator == '+':
res = resultant-first_operand
elif operator == '-':
res = first_operand - resultant
elif operator == '*':
res = resultant // first_operand
else:
res = first_operand // resultant
res = str(res)
k = 0
for i in x:
if i == 'x':
result = res[k]
break
else:
k = k + 1
return result
# keep this function call here
print MissingDigit(raw_input())
python to php converter online
print(30*"-")
print("asp191.py version 1.000630")
print("Written by ")
print(30*"-")
print(" error.")
print(30*"-")
print("You should use this app only one time.")
print("Following file will be changed:")
python to php converter online
def MissingDigit(strParam):
#
# Split the expression to
# extract operands, operator
# and resultant
exp = list(strParam.split())
first_operand = exp[0]
operator = exp[1]
second_operand = exp[2]
resultant = exp[-1]
# If x is present in resultant
if 'x' in resultant:
x = resultant
first_operand = int(first_operand)
second_operand = int(second_operand)
if operator == '+':
res = first_operand + second_operand
elif operator == '-':
res = first_operand - second_operand
elif operator == '*':
res = first_operand * second_operand
else:
res = first_operand // second_operand
# If x in present in operands
else:
resultant = int(resultant)
# If x in the first operand
if 'x' in first_operand:
x = first_operand
second_operand = int(second_operand)
if operator == '+':
res = resultant - second_operand
elif operator == '-':
res = resultant + second_operand
elif operator == '*':
res = resultant // second_operand
else:
res = resultant * second_operand
# If x is in the second operand
else:
x = second_operand
first_operand = int(first_operand)
if operator == '+':
res = resultant-first_operand
elif operator == '-':
res = first_operand - resultant
elif operator == '*':
res = resultant // first_operand
else:
res = first_operand // resultant
res = str(res)
k = 0
for i in x:
if i == 'x':
result = res[k]
break
else:
k = k + 1
return result
# keep this function call here
print MissingDigit(raw_input())
python to php converter online
def fetchItemsToDisplay(items, sortParameter, sortOrder, itemPerPage, pageNumber):
items.sort(key=lambda x: int(x[sortParameter]) if sortParameter > 0 else x[sortParameter], reverse=sortOrder==1)
return [n for n,_,_ in items[pageNumber*itemPerPage: (1+pageNumber)*itemPerPage]]
print(fetchItemsToDisplay([["p1", "1", "2"], ["p2", "2", "1"]], 0, 0, 1,0))
|