In the code below , if the player use numbers as the input , it will successfully turn the size (string) to datatype number , but if the player type something other than numbers, it will cause the program error.
How can the program avoid this case happen? I have thought about using the command type() to avoid this mistake but i don't think it work.So how can we test for these problem.
Sorry for my poor English, I am just a student in Hong Kong , so my English is not well.
size = raw_input("select the size of the map") size2 = int(size)