Python for non-Pythonians by Grossetti Francesco; Rubera Gaia;
Author:Grossetti, Francesco; Rubera, Gaia;
Language: eng
Format: epub
Publisher: EGEA Spa - Bocconi University Press
Published: 2019-06-14T00:00:00+00:00
âIf we sell more than 10 coffee, just let me know it otherwise apply a 10% discount.â
The word otherwise is translated in Python by the reserved keyword else. and the use is similar to if. Of course, there wouldnât be any otherwise without an if so the else command works in conjunction with if. Letâs write in Python the above statement:
n_coffee = 5 if n_coffee >= 10: print('You just sold more than 10 coffees') else: print('Buy a coffee with 10% discount!') ## Buy a coffee with 10% discount!
As you can see, Python checked the first condition given by the if and found it to be false. Then it checked the way out given by the else and found it to be true so it printed the message.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Ada | Ajax |
Assembly Language Programming | Borland Delphi |
C & C++ | C# |
CSS | Compiler Design |
Compilers | DHTML |
Debugging | Delphi |
Fortran | Java |
Lisp | Perl |
Prolog | Python |
RPG | Ruby |
Swift | Visual Basic |
XHTML | XML |
XSL |
Hello! Python by Anthony Briggs(9510)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9482)
The Mikado Method by Ola Ellnestam Daniel Brolund(9436)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7972)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7516)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7512)
Grails in Action by Glen Smith Peter Ledbrook(7409)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7230)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6105)
Kotlin in Action by Dmitry Jemerov(4761)
Windows APT Warfare by Sheng-Hao Ma(4192)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4097)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(3905)
Functional Programming in JavaScript by Mantyla Dan(3810)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(3738)
Mastering Python for Finance by Weiming James Ma;(2943)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2927)
Learning Java by Patrick Niemeyer & Daniel Leuck(2919)
WordPress Plugin Development Cookbook by Yannick Lefebvre(2787)