In [1]:

```
print "Enter two positive integers: ";
n = int(raw_input())
d = int(raw_input())
if (n%d):
print "%d is not divisible by %d" %(n,d)
```

In [2]:

```
print "Enter two positive integers: ";
n = int(raw_input())
d = int(raw_input())
if (n%d):
print "%d is not divisible by %d" %(n,d)
else:
print "%d is divisible by %d" %(n,d)
```

In [3]:

```
print "Enter two integers: "
m = int(raw_input())
n = int(raw_input())
if (m < n):
print "%d is the minimum." %m
else:
print "%d is the minimum." %n
```

In [1]:

```
print "Enter an integer: "
n = int(raw_input())
if (n == 22):
print "%d = 22" %n
else:
print "%d != 22" %n
```

In [5]:

```
print "Enter three integers: "
n1 = int(raw_input())
n2 = int(raw_input())
n3 = int(raw_input())
m=n1
# now min <= n1
if (n2 < m):
m = n2 # now min <= n1 and min <= n2
if (n3 < m):
m = n3 # now min <= n1, min <= n2, and min <= n3
print "Their minimum is %d" % m
```

In [6]:

```
print "Enter two integers: "
x = int(raw_input())
y = int(raw_input())
if (x > y):
temp=x
x = y
y = temp
print "%d <= %d" %(x,y)
```

In [7]:

```
n=44
print "n = %d" % n
if True:
# scope extends over 4 lines
print "Enter an integer: "
n = int(raw_input())
print "n = %d" % n
if True:
print "n = %d" % n
# the n that was declared first
if True:
print "n = %d" % n
print "n = %d" % n
```

In [8]:

```
print "Enter three integers: "
n1 = int(raw_input())
n2 = int(raw_input())
n3 = int(raw_input())
if (n1 <= n2 and n1 <= n3):
print "Their minimum is %d" % n1
if (n2 <= n1 and n2 <= n3):
print "Their minimum is %d " % n2
if (n3 <= n1 and n3 <= n2):
print "Their minimum is %d" % n3
```

In [9]:

```
print "Are you enrolled (y/n): "
ans = raw_input()
if (ans == 'Y' or ans == 'y'):
print "You are enrolled.\n"
else:
print "You are not enrolled.\n"
```

In [10]:

```
print "Enter two positive integers: ";
n = int(raw_input())
d = int(raw_input())
if (d != 0 and n%d == 0):
print "%d divides %d" %(d,n)
else:
print "%d does not divide %d"% (d,n)
```

In [11]:

```
print "Enter three integers: "
n1 = int(raw_input())
n2 = int(raw_input())
n3 = int(raw_input())
if (n1 >= n2 >= n3):
print "max = x"
```

In [12]:

```
print "Enter two positive integers: "
n = int(raw_input())
d = int(raw_input())
if (d != 0):
if (n%d == 0):
print d,
print " divides %d" % n
else:
print "%d does not divide %d" %(d,n)
else:
print '%d does not divide %d '%(d,n)
```

In [13]:

```
print "Enter three integers: "
n1 = int(raw_input())
n2 = int(raw_input())
n3 = int(raw_input())
if (n1 < n2):
if (n1 < n3):
print "Their minimum is : %d" % n1
else:
print "Their minimum is : %d" % n3
else: # n1 >= n2
if (n2 < n3):
print "Their minimum is : %d" % n2
else:
print "Their minimum is %d" % n3
```

In [14]:

```
print "Pick a number from 1 to 8."
answer = int(raw_input())
print "Is it less than 5? (y|n): "
answer = raw_input()
if (answer == 'y'): # 1 <= n <= 4
print "Is it less than 3? (y|n): "
answer = raw_input()
if (answer == 'y'): # 1 <= n <= 2
print "Is it less than 2? (y|n): "
answer = raw_input()
if (answer == 'y'):
print "Your number is 1."
else:
print "Your number is 2."
else: # 3 <= n <= 4
print "Is it less than 4? (y|n): "
answer = raw_input()
if (answer == 'y'):
print "Your number is 3."
else:
print "Your number is 4."
else: # 5 <= n <= 8
print "Is it less than 7? (y|n): "
answer = raw_input()
if (answer == 'y'): # 5 <= n <= 6
print "Is it less than 6? (y|n): "
answer = raw_input()
if (answer == 'y'):
print "Your number is 5."
else:
print "Your number is 6."
else: # 7 <= n <= 8
print "Is it less than 8? (y|n): "
answer = raw_input()
if (answer == 'y'):
print "Your number is 7."
else:
print "Your number is 8."
```

In [15]:

```
language = raw_input("Engl., Fren., Ger., Ital., or Rus.? (e|f|g|i|r): ")
if (language == 'e'):
print "Welcome to ProjectEuclid."
elif (language == 'f'):
print "Bon jour, ProjectEuclid."
elif (language == 'g'):
print "Guten tag, ProjectEuclid."
elif (language == 'i'):
print "Bon giorno, ProjectEuclid."
elif (language == 'r'):
print "Dobre utre, ProjectEuclid."
else:
print "Sorry; we don't speak your language."
```

In [16]:

```
score = int(raw_input("Enter your test score: "))
a = int(score/10)
if a == 10 or a == 9:
print "Your grade is an A."
elif a == 8:
print "Your grade is a B."
elif a == 7:
print "Your grade is a C."
elif a == 6:
print "Your grade is a D."
elif a==5 or a==4 or a==3 or a==2 or a==1 or a==0:
print "Your grade is an F."
else:
print "Error: score is out of range.\n"
```

In [17]:

```
score = int(raw_input("Enter your test score: "))
a = int(score/10)
if a == 10 or a == 9:
print "Your grade is an A."
elif a == 8:
print "Your grade is a B."
elif a == 7:
print "Your grade is a C."
elif a == 6:
print "Your grade is a D."
elif a==5 or a==4 or a==3 or a==2 or a==1 or a==0:
print "Your grade is an F."
else:
print "Error: score is out of range.\n"
print "Goodbye."
```

In [18]:

```
score = int(raw_input("Enter your test score: "))
a = int(score/10)
if a == 10 or a == 9:
print "Your grade is an A."
elif a == 8:
print "Your grade is a B."
elif a == 7:
print "Your grade is a C."
elif a == 6:
print "Your grade is a D."
elif a==5 or a==4 or a==3 or a==2 or a==1 or a==0:
print "Your grade is an F."
else:
print "Error: score is out of range.\n"
print "Goodbye."
```

In [19]:

```
print "Enter two integers: "
m = int(raw_input())
n = int(raw_input())
print min(m,n),
print 'is the minimum'
```