473,396 Members | 2,010 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,396 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 14390
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.