@Brawn/

Day 3 Python

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
Example 1: int(input()), in
input() → Prompts user to input string data
int(input()) → Prompts user to input integer data


i = int(input("Pick a number 1 through 10: "))
even = [2, 4, 6, 8, 10]
if i in even:
    print("{} is even.".format(i))
else:
    print("{} is odd.".format(i))

"""


"""
Example 2: int(input()), not in
We can use in or not in to see if data is in a list
"""

"""
i = int(input("Pick a number 1 through 10: "))
even = [2, 4, 6, 8, 10]
if i not in even:
    print("{} is odd.".format(i))
else:
    print("{} is even.".format(i))

"""

"""
Example 3: int Type Casting
"""
"""
i = int(input("Pick a number 1 through 100: "))
print(int(i/2))
print(i/2)
if int(i/2) == i/2:
    print("{} is even.".format(i))
else:
    print("{} is odd.".format(i))
"""

"""
Problem 1: Input an integer. If the integer is divisible by 3, print whether it is or not.
"""
i = int(input("Pick a number, any number: "))
if int(i/3) == i/3:
    print("{} is divisible by 3.".format(i))
else:
    print("{} is not divisible by 3.".format(i))