473,226 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

Make a Word into Letters

Ok, I am a complete noob to programing. So in the script I was trying to write I needed to change a word like Cat or Dog. Into the letters 'C' , 'A' , 'T' or
'D' , 'O' , 'G'. I know how to use the 'split' command and I can to the basic stuff but please if your going to respond, make it easy to understand. Thanks

Ps. If your wondering I am making a Hangman game and I need the help to check the letters individually.
Sep 26 '07 #1
2 14383
ghostdog74
511 Expert 256MB
Ok, I am a complete noob to programing. So in the script I was trying to write I needed to change a word like Cat or Dog. Into the letters 'C' , 'A' , 'T' or
'D' , 'O' , 'G'. I know how to use the 'split' command and I can to the basic stuff but please if your going to respond, make it easy to understand. Thanks

Ps. If your wondering I am making a Hangman game and I need the help to check the letters individually.
read the tutorial on the python docs site.
Sep 26 '07 #2
bvdet
2,851 Expert Mod 2GB
Ok, I am a complete noob to programing. So in the script I was trying to write I needed to change a word like Cat or Dog. Into the letters 'C' , 'A' , 'T' or
'D' , 'O' , 'G'. I know how to use the 'split' command and I can to the basic stuff but please if your going to respond, make it easy to understand. Thanks

Ps. If your wondering I am making a Hangman game and I need the help to check the letters individually.
A word is an iterable.
Expand|Select|Wrap|Line Numbers
  1. >>> for letter in 'word':
  2. ...     print letter
  3. ...     
  4. w
  5. o
  6. r
  7. d
  8. >>> list('word')
  9. ['w', 'o', 'r', 'd']
  10. >>> 
Sep 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Case Nelson | last post by:
Hi there I've just been playing around with some python code and I've got a fun little optimization problem I could use some help with. Basically, the program needs to take in a random list of no...
13
by: Nige | last post by:
To save me re-inventing the wheel, does anyone have a function to capitalise each word in form data? I was thinking along the lines of capitalise the first letter of the string, then any other...
19
by: pkilambi | last post by:
I wrote this function which does the following: after readling lines from file.It splits and finds the word occurences through a hash table...for some reason this is quite slow..can some one...
3
by: Phil | last post by:
I am looking to set up a hyperlink control on a form to retrieve letters that correspond to a record on a form. That is, there may be 100 form records, and I would like each of those form records...
4
by: pmhaupt2 | last post by:
I developed an Access 2003 program that will allow the user to produce a group of Word letters that merge with data records from an Access database. I created a mail merge Word document and...
0
by: Daniel Sayer | last post by:
Hi, Firstly let me explain the problem, we have an a vb.net application which prints letters to a printer (either a local or remote printer). The application uses the Microsoft Word Object to...
6
by: pj | last post by:
Hi, I 'm currently writing a program that performs transliteration (i.e., converts greek text written using the english alphabet to "pure" greek text using the greek alphabet) as part of my...
209
by: arnuld | last post by:
I searched the c.l.c archives provided by Google as Google Groups with "word input" as the key words and did not come up with anything good. C++ has std::string for taking a word as input from...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.