TORONTO KIDS COMPUTER CLUB | Saturday 16:30 Python Practice – 22.05.14.
20650
post-template-default,single,single-post,postid-20650,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

Saturday 16:30 Python Practice – 22.05.14.

19 May Saturday 16:30 Python Practice – 22.05.14.

Question 1:
Write a program to use easygui enterbox that asks for your name, then street, then city, then province, then postal code (all in easygui message boxes). The program should then display a mailing-style full address that looks something like this:

Hint:
Do not forget to import easygui in order to use enterbox and msgbox. You can type the following code to get the input from enterbox:
name = easygui.enterbox('What is your name?')

'\n' can help you create a new line
for example, if we type the following code: 

print('Kevin\nZhu')

it will show Kevin and Zhu in two different lines
Kevin
Zhu


Question 2:

Use EasyGui to write a program to convert temperatures from Fahrenheit to Celsius. The formula for that is: Celsius = 5 / 9 * (Fahrenheit – 32). Use GUI input and output. You need to create a easygui enterbox to ask Fahrenheit, then use message box to show the Celsius degree. (Hint: the input you get from the enter box is a string, so you need float() to convert it into decimal number.


Class review and Hint:

No Comments

Sorry, the comment form is closed at this time.