Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Alice is sending a short email message to Bob. She wants to format the message on screen so she knows what she is sending. She

Alice is sending a short email message to Bob. She wants to format the message on screen so she knows what she is sending. She is using the string called template below. Change the value of the template string to make it better. You can run the block to get further instructions.

template = {0} {1} {2} {3}

# Edit this string # Leave this alone please # check('p1', template.format("alice@domain.org", "bob@domain.org", "Alice's Subject", "This is my one line message!"))

image text in transcribed
image text in transcribed
Change thr value of the template to show her message of a notification
In [13]: print ( 200 University Ave. Waterloo, ON) 200 University Ave. Waterloo, ON Exercise Alice is sending a short email message to Bob. She wants to format the message on screen so she knows what she is sending. She is using the string called template below. Change the value of the template string to make it better. You can run the block to get further instructions. * Subject""This is my one line message: In [19]: template - {0) (1) (2) (3) Edit this string Leave this alone please check('pl', template.format("alice@domain.org", "bobedomain. fromemail - "alice@domain.org" toemail - "bobedomain.org" subject- 'Alice's Subject yourmessage - "This is my one line message!" string "Hello, {0}! print("fello, format(toenail) (0) 1) (2) (3).format("alicef domain.org", "bobedomain.org', 'Alice's Subject", "This is my one line message!") e cipython-input-19-c33b92d4e0bb, line 9 print("Hello, format(toenaill) Syntaxirror Invalid syntax Part 3 If Else Has an application ever ask you a question? Maybe it asks you if you really want to quit because unsaved changed might lost, or if you want to leave a webpage. If you answer OK one thing happen, like your application closing, but if you answer No or Cancel something else happens. In all those cases there is a special piece of code that is being run somewhere, it is an it condition. Like all languages, Python allows us to conditionally run code. File Edit View Insert Cell Kernel Widgets Logout Control Panel Help Tuled Python 3 O A line ending is one example of something which is part of text on the screen that we need to somehow represent in a string. The key is the balash character. "n" and "Un represents two kind of line endings. Try adding in the right place to make it appear like the test the beginning of this section In [13): print('200 University Ave. Waterloo, ON) 200 University Ave. Waterloo, ON Exercise Alice is sending a short email message to Bob. She wants to format the message on screen so she knows what she is sending. She is using the string called template below. Change the value of the template string to make it better. You can run the block to get further instructions In [37]: template - (O) (1) (2) (3) + Edit this string Leave this alone please check('pl', template.format("alice domain.org", "bobedomain.org', 'Alice's Subject', 'This is my one line message!")) Part 3 If Else Has an application ever ask you a question? Maybe it asks you if you really want to quit because unsaved changed might lost, or you want to leave a webpage. If you answer OK one thing happen, like your application closing, but you answer No or Cancel something else happens. In all those me there is a special piece of code that is being run somewhere, it is an if condition. Like all languages, Python allows us to conditionally run code To have an if condition we need the idea of something being true and something being false. Remember, we call numbers integers" and "floating point, and text strings. We call true or false "boolean' values. True would represent OK where as false would represent No or Cancel in the example above. The literal values in Python for true and false are "True" and "False In 1 J. Palse is False In 1]: True is True In [13]: print ( 200 University Ave. Waterloo, ON) 200 University Ave. Waterloo, ON Exercise Alice is sending a short email message to Bob. She wants to format the message on screen so she knows what she is sending. She is using the string called template below. Change the value of the template string to make it better. You can run the block to get further instructions. * Subject""This is my one line message: In [19]: template - {0) (1) (2) (3) Edit this string Leave this alone please check('pl', template.format("alice@domain.org", "bobedomain. fromemail - "alice@domain.org" toemail - "bobedomain.org" subject- 'Alice's Subject yourmessage - "This is my one line message!" string "Hello, {0}! print("fello, format(toenail) (0) 1) (2) (3).format("alicef domain.org", "bobedomain.org', 'Alice's Subject", "This is my one line message!") e cipython-input-19-c33b92d4e0bb, line 9 print("Hello, format(toenaill) Syntaxirror Invalid syntax Part 3 If Else Has an application ever ask you a question? Maybe it asks you if you really want to quit because unsaved changed might lost, or if you want to leave a webpage. If you answer OK one thing happen, like your application closing, but if you answer No or Cancel something else happens. In all those cases there is a special piece of code that is being run somewhere, it is an it condition. Like all languages, Python allows us to conditionally run code. File Edit View Insert Cell Kernel Widgets Logout Control Panel Help Tuled Python 3 O A line ending is one example of something which is part of text on the screen that we need to somehow represent in a string. The key is the balash character. "n" and "Un represents two kind of line endings. Try adding in the right place to make it appear like the test the beginning of this section In [13): print('200 University Ave. Waterloo, ON) 200 University Ave. Waterloo, ON Exercise Alice is sending a short email message to Bob. She wants to format the message on screen so she knows what she is sending. She is using the string called template below. Change the value of the template string to make it better. You can run the block to get further instructions In [37]: template - (O) (1) (2) (3) + Edit this string Leave this alone please check('pl', template.format("alice domain.org", "bobedomain.org', 'Alice's Subject', 'This is my one line message!")) Part 3 If Else Has an application ever ask you a question? Maybe it asks you if you really want to quit because unsaved changed might lost, or you want to leave a webpage. If you answer OK one thing happen, like your application closing, but you answer No or Cancel something else happens. In all those me there is a special piece of code that is being run somewhere, it is an if condition. Like all languages, Python allows us to conditionally run code To have an if condition we need the idea of something being true and something being false. Remember, we call numbers integers" and "floating point, and text strings. We call true or false "boolean' values. True would represent OK where as false would represent No or Cancel in the example above. The literal values in Python for true and false are "True" and "False In 1 J. Palse is False In 1]: True is True

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_2

Step: 3

blur-text-image_3

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions