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

9th Aug 2018, 4:54 PM
Imagine Existance
Imagine Existance - avatar
10 Réponses
+ 7
39 | print(s,"#"+str(len(l)) You didn' t close the parenthesis
9th Aug 2018, 5:07 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 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
9th Aug 2018, 8:36 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 4
try this n=fac(len(list(s)))/fac(facdev(s))
11th Aug 2018, 7:01 AM
Mert Yazıcı
Mert Yazıcı - avatar
+ 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
11th Aug 2018, 2:35 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 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
9th Aug 2018, 8:43 PM
Imagine Existance
Imagine Existance - avatar
+ 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
11th Aug 2018, 12:23 AM
Imagine Existance
Imagine Existance - avatar
+ 1
i used "wwwwyouw" as an example
11th Aug 2018, 12:29 AM
Imagine Existance
Imagine Existance - avatar
+ 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
11th Aug 2018, 12:45 PM
Imagine Existance
Imagine Existance - avatar
+ 1
i just took the factorial of stc and then multiplied and it worked
11th Aug 2018, 2:39 PM
Imagine Existance
Imagine Existance - avatar
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
9th Aug 2018, 5:14 PM
Imagine Existance
Imagine Existance - avatar