Ay |
Mike Jaeger, 2002 |
Rating:
(2) |
|
Sector: Zeytinlik UIAA: 7 Length: 22m, Bolts: 7 Protection: |
Shade: never Shade in Summer: never Dry When Raining: no Dries Fast: - |
Overhang: - Fingerpower: - Slopes: - Boulderproblem: - Endurance: - |
Comment by: Ofentse, at 29.03.2013, 19:40
Hello,I am a new python prramgmoer and I wanted to write a program which calculates the Turkish states for the entered number plate codes and vice versa. ÐапÑимеÑ, the biggest city in Turkey is Istanbul and its number plate code is 34. It means that if a car is bought in Istanbul, it will have a number plate code starting with 34. The full code resembles something like 34 ATC 57. We are only interested in the first portion, 34, because it tells us the hometown of the car driver, и Ñ.н..I translated the whole program without translating the codes for your convenience. Please check the program and tell me how it can be improved.Thank you.BA#! /usr/bin/env python#-*- coding: utf-8 -*-kodlar = {1: Ðдана , 2: Adiyaman , 3: ÐпиÑм , 4: Agri , 5: Amasya , 6: Ankara , 7: ÐнÑÐ°Ð»Ð¸Ñ , 8: Artvin ,9: ÐйдÑн , 10: ÐалÑкеÑÐ¸Ñ , 11: Bilecik , 12: Bingol , 13: ÐиÑÐ»Ð¸Ñ , 14: ÐÐ¾Ð»Ñ , 15: Burdur , 16: ÐÑÑÑа ,17: Чанаккале , 18: Cankiri , 19: Corum , 20: Denizli , 21: ÐиаÑÐ±ÐµÐºÐ¸Ñ , 22: ÐдÑин , 23: Elazig ,24: Erzincan , 25: ÐÑзÑÑÑм , 26: Eskisehir , 27: ÐазианÑеп , 28: Giresun , 29: Gumushane , 30: Hakkari ,31: Hatay , 32: Isparta , 33: Icel , 34: ÐÑÑанбÑл , 35: ÐÐ·Ð¼Ð¸Ñ , 36: ÐаÑÑ , 37: ÐаÑÑÐ°Ð¼Ð¾Ð½Ñ , 38: ÐайÑеÑи ,39: Kirklareli , 40: Kirsehir , 41: Kocaeli , 42: ÐÐºÐ¾Ð½Ð¸Ñ , 43: Kutahya , 44: Malatya , 45: Manisa ,46: Kahramanmaras , 47: ÐаÑдин , 48: ÐÑгла , 49: Mus , 50: ÐевÑÐµÑ Ð¸Ñ , 51: Ðигде , 52: Ordu , 53: Rize ,54: Sakarya , 55: Samsun , 56: Siirt , 57: Sinop , 58: Sivas , 59: Tekirdag , 60: Tokat , 61: ТÑабзон ,62: Tunceli , 63: Sanliurfa , 64: Usak , 65: Ðа , 66: Yozgat , 67: Zonguldak , 68: ÐкÑаÑай , 69: ÐайбÑÑÑ ,70: Karaman , 71: Kirikkale , 72: Batman , 73: Sirnak , 74: Bartin , 75: Ardahan , 76: Igdir , 77: Yalova ,78: Karabfck , 79: Kilis , 80: Osmaniye , 81: Duzce }while True: try: print = *140 sec=input( Press \\\'1 to give the number plate code and learn the state, n Press \\\'2 to find the number plate code by entering the name of state, n Press \\\'0 to quit ) print = *140 print Your choice: , sec if sec==0: print Exiting quit() elif sec==1: print You chose to find the name of state by entering number plate code y = input( Enter the number plate code: ) if int(y) 81: print Currently we have 81 states! Please enter the number correctly print Exiting else: cevap = kodlar[y] print The name of state with number plate code %s is: %s %(y, cevap) elif sec==2: print You chose to find the number plate code by entering the name of state z = raw_input( Enter the name of state (Manisa, Чанаккале, и Ñ.н.): ) j = 0 flag = 0 for g in kodlar.values(): if g == z: print Number plate code of %s state is: %s %(z, j+1) flag = 1 j+=1 if flag == 0: print I could not find the state %s you wrote. Please check if it is correct %(z) elif sec 2: print Currently we have only the choices \\\'1 and \\\'2 ! Please try again! quit() except SyntaxError: print You made an error in entering! Please try again except NameError: print You typed letter or letters instead of digits! Please enter digits only.