Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 8, Problem 1PE
Initials
Write a
Expert Solution & Answer
Trending nowThis is a popular solution!
Learn your wayIncludes step-by-step video
schedule04:16
Students have asked these similar questions
Lab Activity for the students:
Exercise 5: Write a program that asks the user to input a letter. The program finds and prints if the letter is
uppercase or lowercase. Then, the program asks the user to input a string and get a three-character substring
from the beginning of the string. (1 Mark )
Example : If the inputs are 'y' and "Community". Then, the program will print:
y is lowercase
The substring is: Com
Q: People often forget closing parentheses when entering formulas. Write a program that asks the user to enter a formula and prints out whether the formula has the same number of opening and closing parentheses.
Q: Write a program that asks the user to enter a word and prints out whether that word contains any vowels.
Q: Write a program that asks the user to enter a string. The program should create a new string called new_string from the user’s string such that the second character is changed to an asterisk and three exclamation points are attached to the end of the string. Finally, print new_string. Typical output is shown below: Enter your string: Qbert Q*ert!!!
Q: Write a program that asks the user to enter a string s and then converts s to lowercase, removes all the periods and commas from s, and prints the resulting string.
Q: Write a program that asks the user to enter a word and determines whether the word is a palindrome or not. A palindrome is a word that reads the same…
Python Programming
Chapter 8 Solutions
Starting Out with Python (4th Edition)
Ch. 8.1 - Assume the variable name references a string....Ch. 8.1 - What is the index of the first character in a...Ch. 8.1 - If a string has 10 characters, what is the index...Ch. 8.1 - Prob. 4CPCh. 8.1 - Prob. 5CPCh. 8.1 - Prob. 6CPCh. 8.2 - Prob. 7CPCh. 8.2 - Prob. 8CPCh. 8.2 - Prob. 9CPCh. 8.2 - What will the following code display? mystring =...
Ch. 8.3 - Prob. 11CPCh. 8.3 - Prob. 12CPCh. 8.3 - Write an if statement that displays Digit" if the...Ch. 8.3 - What is the output of the following code? ch = 'a'...Ch. 8.3 - Write a loop that asks the user Do you want to...Ch. 8.3 - Prob. 16CPCh. 8.3 - Write a loop that counts the number of uppercase...Ch. 8.3 - Assume the following statement appears in a...Ch. 8.3 - Assume the following statement appears in a...Ch. 8 - This is the first index in a string. a. 1 b. 1 c....Ch. 8 - This is the last index in a string. a. 1 b. 99 c....Ch. 8 - This will happen if you try to use an index that...Ch. 8 - This function returns the length of a string. a....Ch. 8 - This string method returns a copy of the string...Ch. 8 - This string method returns the lowest index in the...Ch. 8 - This operator determines whether one string is...Ch. 8 - This string method returns true if a string...Ch. 8 - This string method returns true if a string...Ch. 8 - This string method returns a copy of the string...Ch. 8 - Once a string is created, it cannot be changed.Ch. 8 - You can use the for loop to iterate over the...Ch. 8 - The isupper method converts a string to all...Ch. 8 - The repetition operator () works with strings as...Ch. 8 - Prob. 5TFCh. 8 - What does the following code display? mystr =...Ch. 8 - What does the following code display? mystr =...Ch. 8 - What will the following code display? mystring =...Ch. 8 - Prob. 4SACh. 8 - What does the following code display? name = 'joe'...Ch. 8 - Assume choice references a string. The following...Ch. 8 - Write a loop that counts the number of space...Ch. 8 - Write a loop that counts the number of digits that...Ch. 8 - Write a loop that counts the number of lowercase...Ch. 8 - Write a function that accepts a string as an...Ch. 8 - Prob. 6AWCh. 8 - Write a function that accepts a string as an...Ch. 8 - Assume mystrinc references a string. Write a...Ch. 8 - Assume mystring references a string. Write a...Ch. 8 - Look at the following statement: mystring =...Ch. 8 - Initials Write a program that gets a string...Ch. 8 - Sum of Digits in a String Write a program that...Ch. 8 - Date Printer Write a program that reads a string...Ch. 8 - Prob. 4PECh. 8 - Alphabetic Telephone Number Translator Many...Ch. 8 - Average Number of Words If you have downloaded the...Ch. 8 - If you have downloaded the source code you will...Ch. 8 - Sentence Capitalizer Write a program with a...Ch. 8 - Prob. 10PECh. 8 - Prob. 11PECh. 8 - Word Separator Write a program that accepts as...Ch. 8 - Pig Latin Write a program that accepts a sentence...Ch. 8 - PowerBall Lottery To play the PowerBall lottery,...Ch. 8 - Gas Prices In the student sample program files for...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
(This is a variant of an exercise from Chapter 1.) Create a text file that contains the text " I hate programmi...
Absolute Java (6th Edition)
For each of the following activities, give a PEAS description of the task environment and characterize it in te...
Artificial Intelligence: A Modern Approach
Write a program that determines the change to be dispensed from a vending machine. An item in the machine can c...
Java: An Introduction to Problem Solving and Programming (7th Edition)
In the chapter, we introduced a machine instruction of the form ODROS. Suppose we extended this form to OxDRXS,...
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
A(n)________ occurs when a loop iterates one time too many or one time too few. a. general error b. logic error...
Starting out with Visual C# (4th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 1. This program reads one number, as a string, and assign it to String getData Increment and display getData as integer and double Only strings are to be read 2. This program reads strings only Read ten digits, such as 2345678923 store them in getData, which is a string Display each value and it position in the stringarrow_forwardwrite programs date formarrow_forwardC# language MORSE CODE CONVERTERDesign a program that asks the user to enter a string and thenconverts that string to Morse code. Morse code is a code whereeach letter of the English alphabet, each digit, and variouspunctuation characters are represented by a series of dots anddashes. Table 8-9 shows part of the code. Needs to be two labels, two text boxes and click button for conversionarrow_forward
- C++ Languagearrow_forwardBackward String Design a program that prompts the user to enter a string and then displays the string contents backward. For instance, if the user enters "gravity" the program should display "“ytivarg."arrow_forwardProgramming language: F95 Write a program to declare two strings of length 7 each and then form a new string by concatenation of the two strings mentioned above. Print the two strings and concatenated string in the output.arrow_forward
- Helparrow_forward4. Morse Code Converter Morse code is a code where each letter of the English alphabet, each digit, and vario punctuation characters are represented by a series of dots and dashes. Table 8-4 shows pe of the code. Write a program that asks the user to enter a string, then converts that string to Morse code Table 8-4 Morse code Character Code Character Code Character Code Character Code space space 6. comma H. R period 8. I question mark 6. J T. 0. A K 1 W 3 E 4arrow_forwardAssume letters A, E, I, O, and U as the vowels. Write a program that prompts the user to enter a string and displays the number of vowels and consonants in the string.arrow_forward
- Using a for Loop Summary In this lab the completed program should print the numbers O through 10, along with their values multiplied by 2 and by 10. You should accomplish this using a for loop instead of a counter- controlled while loop. Instructions 1. Write a for loop that uses the loop control variable to take on the values O through 10. 2. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. 3. Execute the program by clicking the Run button at the bottom of the screen. Is the output the same?arrow_forwardTrue or False You cannot store a string in a variable of the char data type.arrow_forwardPig LatinWrite a program that accepts a sentence as input and converts each word to “Pig Latin.” Inone version, to convert a word to Pig Latin, you remove the first letter and place that letterat the end of the word. Then, you append the string “ay” to the word. Here is an example:English: I SLEPT MOST OF THE NIGHTPig Latin: IAY LEPTSAY OSTMAY FOAY HETAY IGHTNAY in pythonarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT