Python Forum
a rudimentary caesar wheel
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a rudimentary caesar wheel
#1
so this is a rudimentary caesar wheel built 'from the ground up'. No classes, functions, or imported modules (other than random from the std lib). It proved significantly more time consuming and difficult to write than I anticipated... I learned that lists tend to ignore duplicate (string char) when populating?

Also on my github acct

here's the src:

#!usr/bin/env python3
#caesarwheel0.py

import random

base_wheel = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n',
'o','p','q','r','s','t','u','v','w','x','y','z']
print(list(enumerate(base_wheel)))
new_wheel = []

spinner = random.randint(0,25)

#populate reorganized base_wheel
for b in base_wheel:
	new_wheel.append(base_wheel[spinner])
	spinner -= 1

word = str(input('enter word: '))

my_letters = list(word.strip())
print(my_letters)
new_word_list = []

for k,v in list(enumerate(base_wheel)):
	if v in my_letters:
		print(f'k:{k}\nm:{v}\n\n')
		new_word_list.append(new_wheel[k])

print(new_word_list)
print(''.join(new_word_list))
Reply


Messages In This Thread
a rudimentary caesar wheel - by mepyyeti - Apr-12-2018, 01:14 AM
RE: a rudimentary caesar wheel - by buran - Apr-12-2018, 09:55 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020