Skip to content

Commit 26703d9

Browse files
committed
Added python files
0 parents  commit 26703d9

File tree

6 files changed

+54
-0
lines changed

6 files changed

+54
-0
lines changed

evenOdd.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Wed Jun 8 11:03:23 2016
4+
5+
@author: ericgrimson
6+
"""
7+
8+
x = int(input('Enter an integer: '))
9+
if x%2 == 0:
10+
print('')
11+
print('Even')
12+
else:
13+
print('')
14+
print('Odd')
15+
print('Done with conditional')

foo.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Wed Jun 15 09:15:09 2016
4+
5+
@author: ericgrimson
6+
"""
7+
8+
x = 6
9+
10+
if x != 5:
11+
print('i am here')
12+
else:
13+
print('no I am not')

lec1.pdf

1.36 MB
Binary file not shown.

nestedConds.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Wed Jun 8 11:07:33 2016
4+
5+
@author: ericgrimson
6+
"""
7+
8+
if x%2 == 0:
9+
if x%3 == 0:
10+
print('Divisible by 2 and 3')
11+
else:
12+
print('Divisible by 2 and not by 3')
13+
elif x%3 == 0:
14+
print('Divisible by 3 and not by 2')

operators.py

Whitespace-only changes.

programm.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
pi = 3.14159 #constant
2+
3+
radius = 2.2
4+
# area of circle
5+
area = pi*(radius**2)
6+
print('Area of circle with radius', radius, 'is', area)
7+
# Increment radius by 1
8+
radius = radius+1
9+
10+
area_2 = pi*(radius**2)
11+
print('Area of circle with radius', radius, 'is', area_2)
12+
print(radius)

0 commit comments

Comments
 (0)