Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Each name below is wrong. Say why, and write a correct name.
Check the first character, any hyphens or spaces, and the keywords.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, compare your working with the solution.
2nd starts with a digit. A correct name: second.my-age has a hyphen, which Python reads as a minus sign. A correct name: my_age.class is a keyword that Python already uses. A correct name: class_name.Check. After the fixes, the program shows 5 12 7B.
Log in to join the discussion.
Loading…