TORONTO KIDS COMPUTER CLUB | PMCA Sunday 09:00 Python Homework 20.02.02.
17026
post-template-default,single,single-post,postid-17026,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Sunday 09:00 Python Homework 20.02.02.

06 Feb PMCA Sunday 09:00 Python Homework 20.02.02.

Question 1.

Write a program that asks for your first name, then asks for your last name, and then prints a message with your first and last names in it.

Hint:
Use input() to ask question and get answer, for example:

firstName = input("What is your first name?")

The string answer as value will be assigned to variable firstName.


Question 2.

Write a program that asks for the dimensions (length and width) of a rectangular room, and then calculates and displays the total amount(area) of carpet needed to cover the room.

Hint:
Use input() to ask question and get answer, however, you can only get string data type of answer. In order to get decimal number as dimensions, you need to use float(input(…..)) which will convert from string answer into a decimal number.

No Comments

Sorry, the comment form is closed at this time.