On 15/02/17 18:00, Adam Howlett wrote: > Write an if-else statement that > assigns 20 to the variable y if the variable x is greater than 100. > Otherwise, it should assign 0 to the variable y. > > Is there an easy way to solve this problem?
Yes, just do what it says. Maybe if I reword the problem slightly it will be easier to see? if the variable x is greater than 100, assign 20 to the variable y, else assign 0 to the variable y. Does that help? -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor