2. A– J, determine the output displayed by the lines of code. Save your code as PE3_2.py str = "py" print (str[0]) print (str[-1]) print('C'[0]) print('C'[-1]) A Output Output C strl = "CODE" print(strl.capitalize () + ' \n'+ strl.upper () + ' \n'+ strl.lower ()) print (str1) Qutnut

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

nEEd help with python...please paste ur indented code here:

 

2.
A- J, determine the output displayed by the lines of code. Save your code as PE3_2.py
str = "py"
print(str[0])
print (str[-1])
print ('C'[0])
print('C' [-1])
A
B
Output
Output
C
strl = "CODE"
print (strl.capitalize () + ' \n'+
strl.upper ()+' \n'+ str1.lower ())
print (str1)
Output
D
str2 =
"computer science"
print (str2.title(),'|', str2[0:8],'|',str2[:3],'L',
str2[-5:-1],'l',str2[-2:] )
Output
E
str3 =
"mississippi"
print ('i =', str3.count ('i'))
print ('s = index[', str3.find('s'), ']')
print ('p =', str3.rfind ('p'))
print ("Miss =
", str3.find ("Miss"))
Output
Transcribed Image Text:2. A- J, determine the output displayed by the lines of code. Save your code as PE3_2.py str = "py" print(str[0]) print (str[-1]) print ('C'[0]) print('C' [-1]) A B Output Output C strl = "CODE" print (strl.capitalize () + ' \n'+ strl.upper ()+' \n'+ str1.lower ()) print (str1) Output D str2 = "computer science" print (str2.title(),'|', str2[0:8],'|',str2[:3],'L', str2[-5:-1],'l',str2[-2:] ) Output E str3 = "mississippi" print ('i =', str3.count ('i')) print ('s = index[', str3.find('s'), ']') print ('p =', str3.rfind ('p')) print ("Miss = ", str3.find ("Miss")) Output
Today's program
print ('lstrip():',str4.lstrip())
print('rstrip ():',str4.rstrip ())
print('strip () : ', str4.strip() + "
str4 =
- Basic IО")
Output
G
print ("012345678901234567890")
print ('A'.rjust(5), 'B'.center (5), 'C'.ljust(5), sep = "")
Output
print ("01234567890123456")
print("{0:^7}{1:4}{2:>6s}".format("one", "two", "three") )
print(f"{"one":^7}{"two":4}{"three":>6s}")
H
Output
I
n=1234
print ("01234567890123456789")
print (f"{n:10}{n:^10 }")
print ("01234567890123456789")
print (f"{n:<10}{n:>10 }")
print ("01234567890123456789")
print (f"{n:10.3f}{n:10, .2f}{n}")
print ("012345678901234567890123456789")
print (f"{n:10.2%}{n:12, .2%}")
Output
J
gl= '''"If {0:s} dream it, {0:s} do it. - Walt Disney"'''
print (ql.format('you can'))
a =
"ONE"
b
= "DAY"
q2 = f"\"{a} {b} or {b} {a}. You decide. Paulo Coelho\""
print (q2)
Output
Transcribed Image Text:Today's program print ('lstrip():',str4.lstrip()) print('rstrip ():',str4.rstrip ()) print('strip () : ', str4.strip() + " str4 = - Basic IО") Output G print ("012345678901234567890") print ('A'.rjust(5), 'B'.center (5), 'C'.ljust(5), sep = "") Output print ("01234567890123456") print("{0:^7}{1:4}{2:>6s}".format("one", "two", "three") ) print(f"{"one":^7}{"two":4}{"three":>6s}") H Output I n=1234 print ("01234567890123456789") print (f"{n:10}{n:^10 }") print ("01234567890123456789") print (f"{n:<10}{n:>10 }") print ("01234567890123456789") print (f"{n:10.3f}{n:10, .2f}{n}") print ("012345678901234567890123456789") print (f"{n:10.2%}{n:12, .2%}") Output J gl= '''"If {0:s} dream it, {0:s} do it. - Walt Disney"''' print (ql.format('you can')) a = "ONE" b = "DAY" q2 = f"\"{a} {b} or {b} {a}. You decide. Paulo Coelho\"" print (q2) Output
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY