xxxxxxxxxx
please tell the error and how to corrct it
xxxxxxxxxx
size = int(input("enter length of list:"))
numlist = [0]*size
i = 0
while(i<size):
numlist[i] = int(input("enter values:"))
i += 1
print(numlist)
mostRepeatedvalue = 0
prevfrequency = 0
frequency = 0
i = 0
while (i < size):
j=0
while(j<len(numlist)):
if numlist[i]== numlist [j]:
prevFrequency += 1
if prevFrequency > frequency:
frequency = prevFrequency
mostRepeatedValue = numlist[i]
alif prevFrequency == frequency:
frequency = prevFrequency
j += i
prevFrequency = 0
i += 1
print("\nmostRepeated value :"+(str(mostRepeated value))
print("\nfrequency is:" +str(frequency))"""
xxxxxxxxxx
import numpy as np
np.random.seed(0)
msin_estimates = [None]*50
msin_std = [None]*50
for i in range(1, 51):
unif_array = uniform.rvs(size = i*1000)*np.pi
sin_val = np.sin(unif_array)*np.pi
msin_estimates[i-1] = np.mean(sin_val)
msin_std[i-1] = np.std(sin_val)/np.sqrt(i*1000)
xxxxxxxxxx
amount_to_change = int(input())
num_fives = amount_to_change//5
num_ones = amount_to_change% 5
print('Change for $',amount_to_change)
print(num_fives,'five dollar bill(s)',num_ones,'one dollar bill(s)')
xxxxxxxxxx
H=eval(input("Height"))
W=eval(input("weight"))
BMI=W/H**2
if BMI<=18.5:
print("underweight")
else:
if BMI>18.5 and <25:
print("fit")
else:
if BMI>25
print("overweight")
xxxxxxxxxx
x=int(input("Soit f(x)=racine(3x+5). Donner un nombre réel :")
racine==3*x+9
if racine=<0
print(x,"est une valeur interdite de f")
else
print(x "fait partie du domaine de définition de f")
xxxxxxxxxx
#Can anyone fix this
pctr=0
price=['1','2','3','4','5','6','7','8','9','0'] #array value
#enter a set of integer value
price=input('enter integer value')
#count the length of the character
ppcode=len(price)
print('Coded value :')
while (pctr<=ppcode):
pctr=pctr+0
if price[pctr]=='1':
print('A')
elif price[pctr]=='2':
print('B')
elif price[pctr]=='3':
print('C')
elif price[pctr]=='4':
print('D')
elif price[pctr]=='5':
print('E')
elif price[pctr]=='6':
print('F')
elif price[pctr]=='7':
print('G')
elif price[pctr]=='8':
print('H')
elif price[pctr]=='9':
print('I')
elif price[pctr]=='0':
print('J')
else:
print('invalid price code!')
break
pctr=pctr+1
else:
print('end of process')
xxxxxxxxxx
import re
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
def check(email):
if(re.seach(regex,email)):
print("valid email")
else:
print("invalid email")
if __name__ == "__main__"
email = input("enter Email address: ")
check(email)
xxxxxxxxxx
maximum = 0
max_team = 0
for t in rslt["Team"]:
d = rslt[rslt["Team"] == t]
if int(d["Points"]) > 25:
win_percentage = int((d["Won"]/d["Matches"])*100)
if win_percentage > maximum:
maximum = win_percentage
print(int(d["Won"]/d["Matches"]*100)
print("max", maximum)
max_team = t
print(t)