Selekt1234
Badges: 10
Rep:
?
#1
Report Thread starter 4 weeks ago
#1
...
0
reply
Rufus the red
Badges: 17
Rep:
?
#2
Report 4 weeks ago
#2
It might help if you elaborate.
0
reply
Baleroc
Badges: 9
Rep:
?
#3
Report 4 weeks ago
#3
(Original post by Selekt1234)
so I had a problem but then it went away and now it's back
so its meant to check if its an anagram by checking the number of letters appear in two different input
if two words have the same number of letters and they appear the same number of time then its an anagram
but when entering ll (two L in lowercase) it reads it as an integer and gives me an error message
You should read your errors more carefully. It tells you the answer:

Line 17, dict[i] = dict + 1

I think your problem is:
dict + 1
I don't think dict in your code is an integer. So, you're adding 1 to a dict and not an integer.

You are adding 1 to the variable dict. Is dict an integer? Whenever you use '+1' it defaults to adding an int. If you wanted to add +1, I'm assuming you should be using:
dict[i] = dict[i] + 1

Assuming the value stored at dict[i] is an integer. If the value stored at dict[i] is not an integer, you will have the same issue.
Last edited by Baleroc; 4 weeks ago
1
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Should there be a new university admissions system that ditches predicted grades?

No, I think predicted grades should still be used to make offers (715)
33.87%
Yes, I like the idea of applying to uni after I received my grades (PQA) (904)
42.82%
Yes, I like the idea of receiving offers only after I receive my grades (PQO) (399)
18.9%
I think there is a better option than the ones suggested (let us know in the thread!) (93)
4.41%

Watched Threads

View All