Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help for beginner :)
#1
Hey guys,
I am very beginner and trying to code numbers to characters and reverse.
I always get an error on line 23. I have no idea how to solve this because i need the user to input a list of numbers.
Thanks for you help'

print('1 - budu kodovat text na cislo')
print('2 - budu kodovat cislo na text')
zadej = int(input('Zadej cislo 1 nebo 2'))



if zadej == 1:
    zakodovat = input('Co chces zakodovat?')
    delka = len(zakodovat)
    kod = ''
    for i in range(0,delka):
        pismeno = zakodovat[i]
        cislo = ord(pismeno)-96
        kod = kod + str(cislo)
    print(kod)
    

else:
    zakodovat2 = input('Zadej seznam')
    delka = len(zakodovat2)
    kod = ''
    for i in range(0,delka):
        cislo = int(zakodovat2[i])
        pismeno = chr(cislo+96)
        kod = kod + pismeno
    print(kod)
buran wrote Feb-14-2019, 02:31 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Quote
#2
Please, always post the entire traceback that you get. We need to see the whole thing.
Take a time to read What to include in a post
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Very beginner but please help! thurpe 2 297 Jul-31-2018, 04:04 PM
Last Post: thurpe
  beginner Kyrophis 1 353 Jun-26-2018, 05:25 PM
Last Post: Larz60+
  Very beginner needs help bostltch 3 593 Feb-04-2018, 12:17 AM
Last Post: Larz60+
  Beginner willianramos 4 854 Oct-13-2017, 07:36 PM
Last Post: willianramos
  Beginner needs help Waelrt 1 660 Aug-19-2017, 10:29 AM
Last Post: hbknjr

Forum Jump:


Users browsing this thread: 1 Guest(s)