Question: Programming doesn't just concern numbers. Text is one of the most common types of values used in programs. A snippet of text is represented by

 Programming doesn't just concern numbers. Text is one of the mostcommon types of values used in programs. A snippet of text is

Programming doesn't just concern numbers. Text is one of the most common types of values used in programs. A snippet of text is represented by a string value in Python. The word "string" is a programming term for a sequence of characters. A string might contain a single character, a word, a sentence, or a whole book. To distinguish text data from actual code, we demarcate strings by putting quotation marks around them. Single quotes ( ') and double quotes ( ") are both valid, but the types of opening and closing quotation marks must match. The contents can be any sequence of characters, including number: and symbols. Just like names can be given to numbers, names can be given to string values. The names and strings aren't required to be similar in any way. Any name can be assigned to any string. one = 'two' plus = ' print (one, plus, one) two two Question 5 Yuri Gagarin was the first person to travel through outer space. When he emerged from his capsule upon landing on Earth, he reportedly had the following conversation with a woman and girl who saw the landing: The woman asked: "Can it be that you have come from outer space?" Gagarin replied: "As a matter of fact, I have!" The cell below contains unfinished code. Fill in the i so that it prints out this conversation exactly as it appears above. Question 6 Finish the line num_avenues_away = in the next cell so that the cell calculates the distance Chunhua must walk and gives it the name manhattan_distance. Everything else has been filled in for you. Use the function. \# Here's the number of streets away: num_streets_away =abs(4234) \# Compute the number of avenues away in a similar way: num_avenues_away = street_length_m =80 avenue_length_m =274 \# Now we compute the total distance Chunhua must walk. manhattan_distance = street_length_m*num_streets_away + avenue_length_m*num_avenues_away \# We've included this line so that you see the distance \# you've computed when you run this cell. You don't need \# to change it, but you can if you want. manhattan_distance Be sure to run the next cell to test your code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!