Given the following statements: s1 = 'Computational Thinking' s2= "Python Rocks!" Show the result of evaluating each of the following string expressions (first answer these without using Python/IDLE and then use Python/IDLE to check your answers): a) 'CSC 110 is all about-->' + s1 b) 4 (s2 [0] + s1 [0] + '!') c) s1 [0:11]

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 27SA
icon
Related questions
Question
Given the following statements:
s1 = 'Computational Thinking'
s2 = "Python Rocks!"
Show the result of evaluating each of the following string expressions (first answer these without using Python/IDLE and then use Python/IDLE to check your answers):
a) 'CSC 110 is all about-->' + s1
b) 4* (s2 [0] + s1 [0] + '!')
c) s1 [0:11]
d) s1 [14:14 + len ('Thinking')] + " in "+s2[ 0:6]
e) s1.split ('a')
f) how many did you get correct above (out of 5 questions), after correcting your answers using IDLE? Which ones did you get incorrect? Do you need any help with understanding with
these?
Transcribed Image Text:Given the following statements: s1 = 'Computational Thinking' s2 = "Python Rocks!" Show the result of evaluating each of the following string expressions (first answer these without using Python/IDLE and then use Python/IDLE to check your answers): a) 'CSC 110 is all about-->' + s1 b) 4* (s2 [0] + s1 [0] + '!') c) s1 [0:11] d) s1 [14:14 + len ('Thinking')] + " in "+s2[ 0:6] e) s1.split ('a') f) how many did you get correct above (out of 5 questions), after correcting your answers using IDLE? Which ones did you get incorrect? Do you need any help with understanding with these?
Expert Solution
Step 1

Note: The answer of the first three subparts are given in this solution. Kindly repoost the remaining subparts in sets of three to get their solutions.

 

Given data:

 

s1='Computational Thinking'

s2="Python Rocks!"

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 8 steps with 6 images

Blurred answer
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