Question: CodeLab CodeLab #1 ----- Language: Python ----- Question: Two variables, num and cost have been assigned values. Write a single statement that outputs num and

CodeLab

CodeLab #1

----- Language: Python

-----

Question: Two variables, num and cost have been assigned values. Write a single statement that outputs num and cost to standard output. Print both values (num first, then cost), separated by a space on a single line that is terminated with a newline character. Do not output any thing else.

These are wrong: 1. print(num,' ',cost)

2. print(num,' ',cost, ' ')

=====

Question: Write a single statement that will print the message "first is" followed by the value of first, and then a space, followed by "second = ", followed by the value of second. Print everything on one line and go to a new line after printing. Assume that the variables have already been given values.

Instructor Notes:

There should be a space between the string "first is" and the value of the first variable.

=====

Question: Write some code that reads in a name and an age into the variables name and age. It then prints the message "The age of NAME is AGE" on a line by itself, where NAME and AGE represent the values read into the variables name and age respectively. For example, if your code read in "Rohit" and 70 then it would print out "The age of Rohit is 70" on a line by itself. There should NOT be a period in the output.

Instructor Notes:

The age needs to be an integer, not a string.

=====

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!