[Tutor] Syntax question
Matthew Polack
matthew.polack at htlc.vic.edu.au
Thu Aug 9 00:10:00 EDT 2018
Hi,
I'm trying to configure a button that prints a variable and calls a
function at the same time...but I can't figure out how to get the syntax
right...or if this is even possible:
print("You have selected to convert "), croptype
I've tried various combinations of the above...but can't get it to
work...any clues as to what I should do:
Thanks,
Matt
code for this part says;
def wheatwords():
print("You have selected to convert "), croptype
price = int(float(input("What is the current price?")))
amount = int(input("\n How much grain in metric tonnes?"))
print("This is")
print(price * amount, "Metric Tonnes")
wheatbutton = Button(root, text="Wheat", fg="black", bg="yellow")
wheatbutton.configure(croptype="wheat", command=wheatwords)
Matthew Polack | Teacher
[image: Emailbanner3.png]
Trinity Drive | PO Box 822
Horsham Victoria 3402
p. 03 5382 2529 m. 0402456854
e. matthew.polack at htlc.vic.edu.au
w. www.htlc.vic.edu.au
--
**Disclaimer: *Whilst every attempt has been made to ensure that material
contained in this email is free from computer viruses or other defects, the
attached files are provided, and may only be used, on the basis that the
user assumes all responsibility for use of the material transmitted. This
email is intended only for the use of the individual or entity named above
and may contain information that is confidential and privileged. If you are
not the intended recipient, please note that any dissemination,
distribution or copying of this email is strictly prohibited. If you have
received this email in error, please notify us immediately by return email
or telephone +61 3 5382 2529** and destroy the original message.*
More information about the Tutor
mailing list