File tree Expand file tree Collapse file tree 4 files changed +82
-0
lines changed
Expand file tree Collapse file tree 4 files changed +82
-0
lines changed Original file line number Diff line number Diff line change 1+ States , x , y
2+ Jammu and kashmir , -93.0 , 257.0
3+ Himachal pradesh , -90.0 , 203.0
4+ Punjab , -120.0 , 188.0
5+ Uttarakhand , -57.0 , 174.0
6+ Haryana , -106.0 , 161.0
7+ Delhi , -94.0 , 143.0
8+ Rajsthan , -154.0 , 116.0
9+ Uttar Pradesh , -29.0 , 114.0
10+ Bihar , 63.0 , 80.0
11+ Jharkhand , 60.0 , 30.0
12+ West Bengal , 100.0 , 36.0
13+ Sikkim , 110.0 , 122.0
14+ Assam , 157.0 , 96.0
15+ Arunachal Pradesh , 218.0 , 136.0
16+ Mizoram , 190.0 , 47.0
17+ Tripura , 170.0 , 45.0
18+ Manipur , 210.0 , 70.0
19+ Nagaland , 220.0 , 99.0
20+ Orissa , 31.0 , -22.0
21+ Chattishgarh , -9.0 , 9.0
22+ Maharastra , -138.0 , -38.0
23+ Gujarat , -199.0 , 38.0
24+ Kerala , -124.0 , -219.0
25+ Tamilnaidu , -82.0 , -203.0
26+ Andhra Pradesh , -65.0 , -98.0
27+ Karnataka , -142.0 , -124.0
28+ Maharastra , -131.0 , -40.0
29+ Lakshdweep , -220.0 , -197.0
30+ Andman , 204.0 , -173.0
31+ Puducherry , -58.0 , -191.0
32+ Madhya Pradesh , -65.0 , 23.0
Original file line number Diff line number Diff line change 1+ import turtle
2+ import pandas
3+
4+ data = pandas .read_csv ("indian_capital.csv" )
5+ screen = turtle .Screen ()
6+ its = turtle .Turtle ()
7+ screen .title ("Indian States Guess" )
8+ screen .addshape ("Indian Map.gif" )
9+ turtle .shape ("Indian Map.gif" )
10+
11+ # Here generate X and y coordinate in map of each state
12+
13+ # def get_x_y(x, y):
14+ # state_name=screen.textinput(title="state_name", prompt="enter")
15+ # print(state_name)
16+ # print(x, y)
17+ #
18+ # screen.onscreenclick(get_x_y)
19+ # turtle.mainloop()
20+
21+ guessed_state_list = {}
22+
23+ while len (guessed_state_list )< 31 :
24+ guess_states = (screen .textinput (title = f"{ len (guessed_state_list )} |50 States Correct" , prompt = "Guess Indian States" )
25+ .title ())
26+
27+ states = data .States .to_list ()
28+
29+ if guess_states == "Exit" :
30+ not_guess_state = []
31+ for i in states :
32+ if i not in guessed_state_list :
33+ not_guess_state .append (i )
34+ data = pandas .DataFrame (not_guess_state )
35+ data .to_csv ('which you not answered.csv' )
36+ break
37+
38+ elif guess_states in states :
39+
40+ if guess_states not in guessed_state_list :
41+ guessed_state_list .append (guess_states )
42+ its = turtle .Turtle ()
43+ its .hideturtle ()
44+ its .penup ()
45+ coordinates = data [data .States == guess_states ]
46+ its .goto (coordinates .x .item (), coordinates .y .item ())
47+ its .write (guess_states )
48+
49+
50+ screen .exitonclick ()
You can’t perform that action at this time.
0 commit comments