Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 8 Assign strings to the names you and this so that the final expression evaluates to a 10-letter English word with three double letters

image text in transcribedimage text in transcribed

Question 8 Assign strings to the names you and this so that the final expression evaluates to a 10-letter English word with three double letters in a row. Essentially we're starting with the word 'beeper' and we want to convert this to another word using the string method replace. Hint: The call to print is there to print out the intermediate result called This should be an English word with two double letters in a row. Hint 2: Run the tests if you're stuck. They'll give you some hints. you = .. this = ..' a = 'beeper' the = a. replace('p', you) print('the:', the) the. replace('bee', this) check('tests/q8.py') Question 9 Use len to find out the number of characters in the very long string in the next cell. (It's the first sentence of the English translation of the French Declaration of the Rights of Man.) The length of a string is the total number of characters in it, including things like spaces and punctuation. Assign sentence_length to that number. a_very_long_sentence = "The representatives of the French people, organized as a National Assembly, believing that the ignoran sentence_length = sentence_length check('tests/q9.py')

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

Students also viewed these Databases questions