number

Run Settings
LanguagePython
Language Version
Run Command
import math a = 33 b = 16 print(a/b) # 2.0625 print(a//b) # 2 print(math.floor(a/b)) # 2 # negative number a = -33 b = 16 print('{0}/{1} = {2}'.format(a, b, a/b)) # -33/16 = -2.0625 print('trunc({0}/{1}) = {2}'.format(a,b,math.trunc(a/b))) # trunc(-33/16) = -2 print('{0}//{1} = {2}'.format(a, b, a//b)) # -33//16 = -3 print('floor({0}//{1}) = {2}'.format(a, b, math.floor(a/b))) # floor(-33//16) = -3 # negative %(mod) is come from “modulo operator a = b * (a//b) + (a%b)”
""" if a == 1: b = 10 else: b = 0 """ a = 1 b = 10 if a == 1 else 0 print(b)
# example 3 l = [1, 2, 5] val = 5 found = False idx = 0 while idx < len(l): if l[idx] == val: found = True break idx += 1 if not found: l.append(val) print(l)
Editor Settings
Theme
Key bindings
Full width
Lines