WEEK 1 :: CRASH COURSE PYTHON ::

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What is a computer program?

A step-by-step recipe of what needs to be done to complete a task, that gets executed by the computer (Being able to write such programs is a super useful skill that you'll acquire through this course.)

Which of the following tasks are good candidates for automation? Check all that apply.

Creating a report on how much each sales person has sold in the last month. Setting a home directory and access permissions for new employees joining your company Populating your company's e-commerce site with the latest products in the catalog.

How does Python compare to other programming languages?

Each programming language has its advantages and disadvantages (Each language has its pros and cons. The best language to choose will depend on the problem you are trying to solve.)

What are some characteristics of the Python programming language? Check all that apply.

Python programs are easy to write and understand (Because the syntax used by Python is similar to the one used by the English language) The python interpreter reads our codes and transforms it into computer instructions (We write our code using Python's syntax and semantics, and the interpreter transforms that into instructions that our computer executes.) We can practice Python using web interpreters or codepads as well as executing it locally (We can practice writing Python code with many different tools available to us, both online and offline)

What's automation?

The process of replacing a manual step with one that happens automatically.

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)

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 = (16*1024*1024*1024)/512 print(sector_amount)

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.

p = 26 total = p ** 6 print(total)

Write a Python script that outputs "Automating with Python is fun!" to the screen.

for i in range(1): print("Automating with Python is fun!")

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. Note: Your result should be in the format of just a number, not a sentence.

print (86400*7)


Set pelajaran terkait

Grade 9 - History - The French Revolution Key Terms

View Set

Chapter 6-Memory: Remembrance of Things Past--and Future

View Set

Entrepreneurial Small Business Ch.1-4

View Set

Past Simple - правилни глаголи

View Set

DECA Finance Cluster Sample Exam #2 of 5

View Set

Intro to Entrepreneurship Mid-term Exam Review

View Set

Adaptive Learning Assignment - Ethics and Privacy Concerns

View Set