diff options
author | Santo Cariotti <sancn@live.com> | 2017-07-23 19:59:49 +0200 |
---|---|---|
committer | Santo Cariotti <sancn@live.com> | 2017-07-23 19:59:49 +0200 |
commit | 73d0deef8bad64e542f73982789bebeb50e347a4 (patch) | |
tree | 43a31a963ce4a44afb7b50293557ce214415c13a /python | |
parent | 25a2f54e4771032c788fe96ef9d58315ac0b33a5 (diff) |
clear
Diffstat (limited to 'python')
-rw-r--r-- | python/.kdev4/python.kdev4 | 30 | ||||
-rw-r--r-- | python/crittografa.py | 2 | ||||
-rw-r--r-- | python/palindroma.py | 29 | ||||
-rw-r--r-- | python/python.kdev4 | 3 |
4 files changed, 52 insertions, 12 deletions
diff --git a/python/.kdev4/python.kdev4 b/python/.kdev4/python.kdev4 new file mode 100644 index 0000000..ccb47d8 --- /dev/null +++ b/python/.kdev4/python.kdev4 @@ -0,0 +1,30 @@ +[Buildset] +BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x0c\x00p\x00y\x00t\x00h\x00o\x00n) + +[Defines And Includes][Compiler] +Name=GCC +Path=gcc +Type=GCC + +[Launch] +Launch Configurations=Launch Configuration 0 + +[Launch][Launch Configuration 0] +Configured Launch Modes=execute +Configured Launchers=scriptAppLauncher +Name=New Script Application Launcher +Type=Script Application + +[Launch][Launch Configuration 0][Data] +Arguments=1010010 +EnvironmentGroup= +Executable= +Execute on Remote Host=false +Interpreter=python3 +Output Filtering Mode=2 +Remote Host= +Run current file=true +Working Directory= + +[Project] +VersionControlSupport=kdevgit diff --git a/python/crittografa.py b/python/crittografa.py index 3c904d5..6df0fc8 100644 --- a/python/crittografa.py +++ b/python/crittografa.py @@ -27,7 +27,6 @@ with open('input.txt', 'r') as fin: for line in fin.readlines(): parole += line - for i in parole: converti(i) @@ -35,3 +34,4 @@ for i in parole: with open('output.txt', 'w') as fout: for i in nuovaParola: fout.write(i) + diff --git a/python/palindroma.py b/python/palindroma.py index af82a04..6c3a7e9 100644 --- a/python/palindroma.py +++ b/python/palindroma.py @@ -1,15 +1,22 @@ -def palindromo(parola, start, end): - if start >= end: - return True - elif parola[start] == parola[end]: - return palindromo(parola, start+1 , end-1) - else: - return False +# def palindromo(parola, start, end): +# if start >= end: +# return True +# elif parola[start] == parola[end]: +# return palindromo(parola, start+1 , end-1) +# else: +# return False +# +# +# parola = input('Parola: ') +# +# if palindromo(parola, 0, len(parola)-1): +# print('Palindroma') +# else: +# print('Non palindroma') +parola = raw_input('Parola: ') -parola = input('Parola: ') - -if palindromo(parola, 0, len(parola)-1): +if parola == parola[::-1]: print('Palindroma') else: - print('Non palindroma') + print('Non palindroma')
\ No newline at end of file diff --git a/python/python.kdev4 b/python/python.kdev4 new file mode 100644 index 0000000..9d6efbd --- /dev/null +++ b/python/python.kdev4 @@ -0,0 +1,3 @@ +[Project] +Manager=KDevGenericManager +Name=python |