-
Notifications
You must be signed in to change notification settings - Fork 8
Code
myfunction(x, y):
return x + y
else:
print("Hello!")
if mark >= 50
print("You passed!")
if flag:
print("Flag is set!")
esle:
print("Bye!")
# with checks
n = None
while n is None:
s = input("Please enter an integer: ")
if s.lstrip('-').isdigit():
n = int(s)
else:
print("%s is not an integer." % s)
def main():
Do this
Do that
try:
dividend = int(input("Please enter the dividend: "))
divisor = int(input("Please enter the divisor: "))
print("%d / %d = %f" % (dividend, divisor, dividend/divisor))
except ValueError:
print("The divisor and dividend have to be numbers!")
except ZeroDivisionError:
print("The dividend may not be zero!")
def main():
Do this
Do that
try:
dividend = int(input("Please enter the dividend: "))
except ValueError:
print("The dividend has to be a number!")
try:
divisor = int(input("Please enter the divisor: "))
except ValueError:
print("The divisor has to be a number!")
try:
print("%d / %d = %f" % (dividend, divisor, dividend/divisor))
except ZeroDivisionError:
print("The dividend may not be zero!")
def main():
Do this
Do that
try:
file = open('input-file', 'open mode')
except:
# In case of any unhandled error, throw it away
raise
def main():
Do this
Do that
try:
age = int(input("Please enter your age: "))
except ValueError:
print("Hey, that wasn't a number!")
else:
print("I see that you are %d years old." % age)
finally:
print("It was really nice talking to you. Goodbye!")
def main():
Do this
Do that
try:
age = int(input("Please enter your age: "))
if age < 0:
raise ValueError("%d is not a valid age. Age must be positive or zero.")
except ValueError as err:
print("You entered incorrect age input: %s" % err)
else:
print("I see that you are %d years old." % age)
import logging
# log messages to a file, ignoring anything less severe than ERROR
logging.basicConfig(filename='myprogram.log', level=logging.ERROR)
# these messages should appear in our file
logging.error("The washing machine is leaking!")
logging.critical("The house is on fire!")
# but these ones won't
logging.warning("We're almost out of milk.")
logging.info("It's sunny today.")
logging.debug("I had eggs for breakfast.")
https://travis-ci.org/mirumee/saleor
- Fitur - Error tracking
- Create dan Install Project
$ pip install --upgrade sentry-sdk==0.7.14
import sentry_sdk
sentry_sdk.init("https://xxxxxx@sentry.io/XXXXXX")
https://codecov.io/gh/mirumee/saleor
https://codeclimate.com/github/mirumee/saleor/pull/2626
This documentation is mapped under Mapping and licensed under Apache License, Version 2.0.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2018-2020 Chetabahana Project
You are on the wiki of our repo
- Site
- Main
- Project
- Pratinjau
- Pola Dasar
- Bagan Kerja
- Field Tutorial
- Cloud Site API
- Google Ads API
- Cloud Tasks API
- Google Trends API
- Basis Implementasi
- Beranda
- Perangkat
- Pasang Aplikasi
- Penyetelan Aplikasi
- Menyiapkan Frontend
- Menjalankan Backend API
- Menjalankan Toko