TORONTO KIDS COMPUTER CLUB | Aurora Saturday 18:30 Python Homework 10.19.
16620
post-template-default,single,single-post,postid-16620,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

Aurora Saturday 18:30 Python Homework 10.19.

23 Oct Aurora Saturday 18:30 Python Homework 10.19.

Question 1:

Create a dictionary variable personalInfo. The keys will be the information to be filled, such as: name, age, address, etc. The values is the personal detailed info, such as: Kevin, 19, 123 King St, etc.


Question 2:

From the dictionary created above, make two lists (make sure it is a list!!), one list only contains all the keys from personalInfo, the other list only contails all the values from the dictionary.


Question 3:

if a = “Hello”, b = “world”, how to use variable a, b and print option to print the result like “Hello **** world”?


Question 4:

for the question 3, how to use % to get the formatted output like “Hello my world”?
Hint: use print(“%s my _______” _____________)


Question 5:

if price = 5.4, how to use % to keep 6 empty space before 5.4 and keep 2 digits after the decimal, the output looks like:

This pen costs       5.40 dollars

No Comments

Sorry, the comment form is closed at this time.