Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python, help me with this, thank you so much! Using Python Strings 1 Create a variable named message and assign it the value of

Using Python, help me with this, thank you so much!
image text in transcribed
Using Python Strings 1 Create a variable named message and assign it the value of "Hello World" 2 Print the value of message 3 Print the value: lenmessage) 4 Apply the concept of index values in the List section and individually display the characters "H". "E", "L", "L","0" using the print function Note: Try using positive indexes, then after seeing the result. Repeat the step using negative indexes. 5 Apply the concept of index values in the List section and display the string "Hold" using the Concatenate (+) operator on individual characters Ex.print(message[0]+ message[1]+ message[2]+message[3]+ message[41) 6 Apply the concept of index slicing in the Index Slicing section and display the word "Hello" as a whole string 7 Apply the concept of index slicing in the Index Slicing section and display the word "World" as a whole string String Methods Observe the result per each String method. 1 Type the command and print the value message uppert) Ex.print(message.upper) 2 Type the command and print the value message. lower) 3 Type the command and print the value message title 4 Print the value "Value lis), and value 2 is {.format(-1,True) 5 Print the value message split('') 6 Print the value message.count(*1') 7 Print the value message.replace("World', 'CPE009") 8 Assign the value message.replace("World". CPE009) to message 9 Type the command: help(*) Find the commands used in previous tasks. The in operator for Strings 1 Type the code as shown: print-W'in message) 2 Type the code as shown: print("old" in message) 3 Type the codes below: word - input("Enter a word: ") if word in "The big brown fox jump over the lazy dog" print("The word is in the text") else: print("The word is not in the text") Using a String in an iterative statement 1 Type the code as shown below: for character in message: print(character) 2 Type the code as shown below:i - 0 while ilen( message ): print(message [i])+1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago