The Python built-in function str () will convert a numerical argument into a character string representation, and the ‘ + ’ can be used to concatenate strings together. Use these to modify the marathon script to produce cleaner output, for example:
Your speed is 7.74193548387 mph
Your total elapsed time is 46 minutes, 30 seconds
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Computer Science: An Overview (12th Edition)
Additional Engineering Textbook Solutions
Problem Solving with C++ (10th Edition)
Starting Out With Visual Basic (8th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Introduction To Programming Using Visual Basic (11th Edition)
- 6. In PHP language, write a program to input a string from the user and print every character of the string in the output separated by the character +. Sample Input: ABCDEF Output: A+B+C+D+E+Farrow_forwardWrite in C language Description Write a program to determine if a string is apalindrome or not. Input Input string will include only letter,please consider uppercase and lowercase as the same. Output Please refer to the sample output. Sample Input 1 AbcBa Sample Output 1 AbcBa is a palindrome. Sample Input 2 AAaab Sample Output 2 AAaab is not a palindrome.arrow_forwardin pythonarrow_forward
- Please help me find the PYTHON CODE for this problem. ASAP! Thank you! What's in the Middle? by CodeChum Admin You already know how to access the middle value of a certain string using index positions, right? Then let's put your learnings to practice. Make a program that shall input a long string that contains an odd number of individual strings separated by comma. Afterwards, input the string that's located in the middle index position. Let's do this. Input A line containing a string separated by a comma. Python,is,fun Output A line containing a string. isarrow_forwardUsing C languagearrow_forwardUsing Python, use import sys Create a program, longest.py, that has a function that takes one string argument and prints a sentence indicating the longest word in that string. If there is more than one word print only the first. Your print statement should read: The longest word is x Where x = the longest word. The word should be all lowercase.arrow_forward
- Python problem. A character string that represents the number n, a number b1 that represents the base on which the number n is written, and a number b2 that is the base to convert the number n. Such that 10 <= n <= 20000000 y 2 <= b1, b2 <= 16. EntryA character string that represents the number n, a number b1 that represents the base on which the number n is written, and a number b2 that is the base to convert the number n. Such that 10 <= n <= 20000000 and 2 <= b1, b2 <= 16. DepartureThe number n converted to the base b2 Examples Input Example 1 7562102Output Example 1 1110110001010 Input Example 2 75621016Output Example 2 1D8A Input Example 3 34AF6519162Output Example 3 110100101011110110010100011001 Input Example 4 3854922113Output Example 4 110120111222122arrow_forwardin C program pleasearrow_forwardIn C++ do not add any extra libraries A palindrome is a string that reads the same backwards and forwards. Use a deque to implement a program that tests whether a line of text is a palindrome. The program reads a line, then outputs whether the input is a palindrome or not. Ex: If the input is: senile felines! the output is: Yes, "senile felines!" is a palindrome. Ex: If the input is: rotostor the output is: No, "rotostor" is not a palindrome. Ignore punctuation and spacing. Assume all alphabetic characters will be lowercase. Special case: A one-character string is a palindromearrow_forward
- Solve in c programming language.arrow_forwardWrite a python program to convert a date string input to the format YYYY-MM-DD Take a date input from the user in the form of: Day Month Year Day can be written in the following format: 1st, 2nd, 3rd, 4th, 5th ..30th, 31st Month can be written in format: Jan, Feb, Mar, Apr, May, Jun, Aug, Sep, Oct, Nov, Dec Year can be any year from 1900 to 2100 Some sample output examples: Example 1: Input: date = 10th Sep 2008 Output: ‘2008-09-10’ Example 2: Input: date = 7th Jul 1976 Output: ‘1975-07-07’ Example 3: Input: date = 30th Dec 1922 Output: ‘1922-12-30’ Assume all inputs given by the user are in the correct, proper format as displayed above, therefore no error handling is necessary on the programmers’ side.arrow_forwardUsing import sys : Create a python program, palindrome.py, that has a function that takes one stringargument and prints a sentence indicating if the text is a palindrome. Thefunction should consider only the alphanumeric characters in the string, and notdepend on capitalization, punctuation, or whitespace.If your string is a palindrome it should print:It's a palindrome!If it is not a palindrome, it should print:It's not a palindrome!arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education