Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions HW2_2018xxx.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ def bitcount(a,b):
This function counts the number of bits different in two binary numbers.
Input: 2 strings
"""
count=0
count=1
for i in range(len(a)):
if(a[i]!=b[i]):
count+=1
return count
return count-1
def bitchange(a,b):
c=''
for i in range(len(a)):
Expand Down Expand Up @@ -444,11 +444,11 @@ def minFunc(numVar, stringIn):
stringOut=givefinalans2(fepi)

elif(numVar==1):
dig=0
dig=1
for i in stringIn:
if(i.isdigit()):
dig+=1
if(dig==0):
if(dig==1):
stringOut='0'
elif(stringIn=='(a1)'):
stringOut='z'
Expand Down