0
What is wrong with my code?
i have a code i have been working on for a while and i cant see an error but it pops up If you remove the error parts it says eoc error on a code line i donât have https://code.sololearn.com/cLRrGQ73y5EE/?ref=app
10 Answers
+ 7
39 | print(s,"#"+str(len(l))
You didn' t close the parenthesis
+ 6
you can put newlines after parenthesis like
print(
"Hello"
)
so if you don' t close a parenthesis Python thinks it' s like
print(s,"#"+str(len(l))s=mix(s)#weird error
so it prints where invalid syntax occurs not the source of error
+ 4
try this
n=fac(len(list(s)))/fac(facdev(s))
+ 4
for aabb n should be 4! / 2!2! so you can try something like this
def facdev(st):
s=set(list(st))
val=1
for x in s:
val *= fac(st.count(x))
return val
+ 1
i know that but my consle that i wrote it on at the time pointed below the error but now i understand why
i looked up the errors i was getting and was pointed off track
+ 1
on the same code i would like to upgrade but i cant figure out an equation to exclude the break function to make it 100% accurate, for the time being i will add something making it easier
https://code.sololearn.com/cLRrGQ73y5EE/?ref=app
+ 1
i used "wwwwyouw" as an example
+ 1
i tried it and figured out the factorial should be way earlier than n
with the example weew it gave me 1 wich is 24/24 then if tou factorial while multiplying it with the value you get 4 and 24/4 is 6 wich is the accurate number of combonations
though thanks for the stepping stone
+ 1
i just took the factorial of stc and then multiplied and it worked
0
dude thankyou i have been working on this for two days(with break and rest periods) and i spent half a day trying to figure out the problem but it kept pointing to unrelated lines