-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule1.py
More file actions
33 lines (22 loc) · 1.21 KB
/
Copy pathmodule1.py
File metadata and controls
33 lines (22 loc) · 1.21 KB
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
#Question 6
#Write a Python script that outputs "Automating with Python is fun!" to the screen.
print("Automating with Python is fun!")
#Question 7
#Fill in the blanks so that the code prints "Yellow is the color of sunshine".
color = "Yellow"
thing = "sunshine"
print(color + " is the color of " + thing)
#Question 8
#Keeping in mind there are 86400 seconds per day, write a program that calculates how many seconds there are in a week, if a week is 7 days. Print the result on the screen.
week_second = 86400 * 7
print(week_second)
#Question 9
#Use Python to calculate how many different passwords can be formed with 6 lower case English letters. For a 1 letter password, there would be 26 possibilities. For a 2 letter password, each letter is independent of the other, so there would be 26 times 26 possibilities. Using this information, print the amount of possible passwords that can be formed with 6 letters.
output = 26 ** 6
print(output)
#Question 10
#Most hard drives are divided into sectors of 512 bytes each. Our disk has a size of 16 GB. Fill in the blank to calculate how many sectors the disk has.
disk_size = 16*1024*1024*1024
sector_size = 512
sector_amount = disk_size / sector_size
print(sector_amount)