If str = "Python Programming" what is the output of print(str[ : 6])     An Error Message     n     Python     Pytho 2. If str = "Python Programming", what is the output of print(str[ -4 ])?     i     m     a     P 3. If str = "Python Programming", what is the output of print(len(str))?     19     18     17     20

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

1. If str = "Python Programming" what is the output of print(str[ : 6])

   

An Error Message

   

n

   

Python

   

Pytho

2. If str = "Python Programming", what is the output of print(str[ -4 ])?

   

i

   

m

   

a

   

P

3. If str = "Python Programming", what is the output of print(len(str))?

   

19

   

18

   

17

   

20

4. Select all that apply:

given str is a variable containning a literal string, which of the following will access the last character of str
 
 
   

str[0]

   

str[-1]

   

str[len(str)]

   

str[len(str) -1]

 
5. if message = "JackandJillwentupthehill" what is the ouput of print(message[7 : 11 ])?
   

Jack

   

Jill

   

Jillw

   

and

 

6. if str = "Python Programming" what is the output of print(str[ 7: ])

   

rogramming

   

gramming

   

An Error Message

   

Programming

 

7. if str = "Python Programming", what is the ouptut of print(str[5])

   

t

   

o

   

n

   

h

8. Once a sting is created its individual characters cannot be changed

 True

 False

 

9. 

  1. The code segment below is free of any errors

     

    str = "Game"

    str[0] = "L"

    print(str)

     True

     False

    10. 

Expert Solution
steps

Step by step

Solved in 7 steps with 3 images

Blurred answer
Knowledge Booster
Algebraic Expressions
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr