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.
2 14390
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.
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. - >>> for letter in 'word':
-
... print letter
-
...
-
w
-
o
-
r
-
d
-
>>> list('word')
-
['w', 'o', 'r', 'd']
-
>>>
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |