Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question
rython
Python's Built-in Methods
ChangeCase.py
1 II
2 ChangeCase.py - This program converts a string to lowercase and uppercase.
Summary
3 Input: Interactive
4 Output: Uppercase and lowercase versions of the user-entered string.
In this lab, you complete a partially written Python program that includes built-in methods that
convert Strings to all uppercase or all lowercase.
6
7 sample = input("Enter a string or done when you want to quit: ")
8
The program prompts the user to enter any string. To end the program, the user can enter "done".
9 while sample != "done":
For each string entered, call the built in methods lower () and upper(). The program should
10
# Call the lower method here and print the result.
call these methods using a string object, followed by a dot ( . ), followed by the name of the
11
method. Both of these methods return a string with the string changed to uppercase or lowercase.
12
print("Lowercase: " + result)
Here is an example:
13
# Call upper method here and print the result.
14
print("Uppercase: " + result)
sample = input ("Enter a string or done when you want to quit: ")
15
16
sample = "This is a String."
result = sample.lower();
result = sample.upper();
17
The source code file provided for this lab includes the necessary input and output statements.
Comments are included in the file to help you write the remainder of the program.
Instructions
1. Make sure the file ChangeCase.py is selected and open.
2. Write the Python statements as indicated by the comments.
3. Execute the program by clicking on the Run button at the bottom of the screen.
expand button
Transcribed Image Text:rython Python's Built-in Methods ChangeCase.py 1 II 2 ChangeCase.py - This program converts a string to lowercase and uppercase. Summary 3 Input: Interactive 4 Output: Uppercase and lowercase versions of the user-entered string. In this lab, you complete a partially written Python program that includes built-in methods that convert Strings to all uppercase or all lowercase. 6 7 sample = input("Enter a string or done when you want to quit: ") 8 The program prompts the user to enter any string. To end the program, the user can enter "done". 9 while sample != "done": For each string entered, call the built in methods lower () and upper(). The program should 10 # Call the lower method here and print the result. call these methods using a string object, followed by a dot ( . ), followed by the name of the 11 method. Both of these methods return a string with the string changed to uppercase or lowercase. 12 print("Lowercase: " + result) Here is an example: 13 # Call upper method here and print the result. 14 print("Uppercase: " + result) sample = input ("Enter a string or done when you want to quit: ") 15 16 sample = "This is a String." result = sample.lower(); result = sample.upper(); 17 The source code file provided for this lab includes the necessary input and output statements. Comments are included in the file to help you write the remainder of the program. Instructions 1. Make sure the file ChangeCase.py is selected and open. 2. Write the Python statements as indicated by the comments. 3. Execute the program by clicking on the Run button at the bottom of the screen.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY