---
# System prepended metadata

title: '*2022/03/25 網路爬蟲 HW01*'
tags: [網路爬蟲]

---

###### tags: `網路爬蟲`
# *2022/03/25 網路爬蟲 HW01*


HW01_1

```
infor=['吳宥陞','男',20,176]
if infor[1]=='男':
    print('哈嘍！我是',infor[0],'先生',',今年',infor[2],'歲','身高',float(infor[3]))
else:
    print('哈嘍！我是', infor[0], '小姐', ',今年', infor[2], '歲', '身高', float(infor[3]))
```
HW01_2
```
temperature=input('Please enter a temperature:')
if temperature[-1]=='c'or temperature[-1]=='C':
    output_1=float(temperature[:-1])
    output=float(output_1)*9/5+32
    print('Celsius',format(output_1,'.2f'),'Degree = Fahrenheit',format(output,'.2f'),'Degree')
elif temperature[-1]=='f'or temperature[-1]=='F':
    output_1 = float(temperature[:-1])
    output=(float(output_1)-32)*5/9
    print('Fahrenheit', format(output_1,'.2f'), 'Degree = Celsius', format(output, '.2f'), 'Degree')
else:
    print('Type ERROR')

```
HW01_3
```
count = int(input('Please enter a number: '))+1
for i in range(1,count):
    print(' '*(count-i),'*'*(2*i-1),' '*(count-i))
```
HW01_4
```
import random
numlist = [0,0,0,0,0]
output = 0
for i in range(5):
    numlist[i] = random.randint(1,10)
    output = output+ numlist[i]
print('The random list:',numlist)
print('The sum: ',output)

```