What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-14 15:44:16
how to convert from binary to base 10 in python
def getBaseTen(binaryVal): count = 0 #reverse the string binaryVal = binaryVal[::-1] #go through the list and get the value of all 1's for i in range(0, len(binaryVal)): if(binaryVal[i] == "1"): count += 2**i ... Add solution -
Python 2021-10-06 07:14:03
how to convert from base 2 to base 10 in python
def getBaseTen(binaryVal): count = 0 #reverse the string binaryVal = binaryVal[::-1] #go through the list and get the value of all 1's for i in range(0, len(binaryVal)): if(binaryVal[i] == "1"): count += 2**i ... Add solution -
Python 2021-09-24 00:39:03
Write a function that tests whether a string is a palindrome
def palindrome_check(string): string = list(string) tmp = [] #remove any spaces for x in range(0, len(string)): if(string[x] != " "): tmp.append(string[x].lower()) #now reverse the string... Add solution