Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Typing a Comment/Saving the File 1. As the first line of code in the new file in IDLE, type a comment using your first and

Typing a Comment/Saving the File

1. As the first line of code in the new file in IDLE, type a comment using your first and last name, like so (this comment should be the only comment in the script): # Harry Styles

2. Press Enter.

3. Save the file on your Desktop as a file named: output.py

4. Press Enter

Typing the Script

1. Declare a new variable named: name

2. As the value for the name variable, type an input statement and compose some prompting text (that ends in a colon) that asks the user to enter his or her first and last name. Note: In the prompting text, make sure there are no typographical, spelling, spacing, punctuation, or capitalization errors. Also make sure there is one space after the colon and before the close quote to leave some room between the end of the prompting text and what the user will input later when the script runs.

3. On a new line, declare a second variable named: age 1

4. As the value for the age variable, type an input statement and compose some prompting text (that ends in a colon) that asks the user to enter his or her age as an integer number. Don't forget that because you are asking the user to enter an integer value, you will have to use a constructor method with this second input statement. Note: In the prompting text, make sure there are no typographical, spelling, spacing, punctuation, or capitalization errors. Make sure there is one space after the colon and before the close quote to leave some room between the end of the prompting text and what the user will later input when the script runs.

5. On a new line, declare a third variable named newAge. The value for the newAge variable should be the age variable +1. Note: Remember to leave a space before and after an operator; for example, type 2 + 2, not 2+2; type a = b, not a=b. Spacing in this manner is the industry standard, so please conform to that standard.

6. On a new line, type a print statement using an f-string that lets the user know what his or her age will be on their next birthday. In the print statement, use the name and the age variables, not the actual text for the person's name and age. In this print statement, you will receive no credit for using any other method other than an f-string for output. In the print statement, don't space after the word \"print.\" Don't space either before or after the letter \"f\" in the f- string code. Your print statement should start like this: print (f\"Enter

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Cryptography And Network Security

Authors: William Stallings

5th Edition

B00F0ZR6PC, 9780136097044

Students also viewed these Programming questions

Question

40. Consider a M/G/1 system with E[S] Answered: 1 week ago

Answered: 1 week ago