-
Notifications
You must be signed in to change notification settings - Fork 0
/
chap1.py
62 lines (46 loc) · 864 Bytes
/
chap1.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
54
55
# chap1.py
# Assign
pi = 3.14
radius = 10.0
circumference = 2 * pi * radius
square_side = 12
area = square_side * square_side
area = square_side ** 2
print("The area of the square is: ", area)
# draw_circle
print(" *** ")
print(" ********* ")
print(" ************* ")
print("***************")
print("***************")
print("***************")
print(" ************* ")
print(" ********* ")
print(" *** ")
# String, Integers, Real number
var = 1
var = 1.0
x = 3
y = 2
3//2
3/2
3%2
6.0//2
7//2 * 2.0
int(3.5)
round(3.5)
radius = input()
radius = float(radius)
#Guess number verson 1
secret_number = 8
print ("Please guess a number between 1 and 10: ")
player_number = int(input())
# IF statement
# if player_number == secret_number:
#Type
x = 10
print(type(x))
x = x*0.1
print(type(x))
x = (x*10 == 10)
print(type(x))