Question
programming language in python
Solicit string from the keyboard one after another till you get a null value input (null means nothing a Carriage Return <CR>
0 0
Add a comment Improve this question Transcribed image text
Answer #1

result=""
ip=input()
while len(ip)>0:
try:
float(ip)
except ValueError:
if len(ip)%2==0:
result+=ip+'-'
else:
result+=ip+':'
ip=input()
  
print(result[:-1])

result= ip=input() while len(ip)>0: try: float(ip) except ValueError: if len(ip)%2==0: result+=ip+- else: result+=ipt:

Add a comment
Know the answer?
Add Answer to:
programming language in python Solicit string from the keyboard one after another till you get a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • could you please help me with this problem, also I need a little text so I...

    could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT