-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemp.py
55 lines (48 loc) · 1.41 KB
/
temp.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
# Python script to print expected results for each code block
# Header for the homework
print("HW 05-A: Explanation of Python Multiple Assignments Code\n")
print("Instructions:")
print("Look over and through the attached Python example code (the latter part) about multiple assignments.")
print("Then run and understand the outputs. Provide the explanation of that part of the given code.")
print("Do screen captures and save your submission in the PDF file format.\n")
print("-" * 80)
# 1. Assigning Multiple Variables in One Line
print("## 1. Assigning Multiple Variables in One Line")
print("Expected Output:")
print("1")
print("2")
print("3")
print("-" * 80)
# 2. Swapping Variables
print("## 2. Swapping Variables")
print("Expected Output:")
print("20")
print("10")
print("-" * 80)
# 3. Unpacking Iterables
print("## 3. Unpacking Iterables")
print("Expected Output:")
print("Jon")
print("30")
print("New York")
print("1 2 3")
print("X Y Z")
print("-" * 80)
# 4. Using `*` for Extended Unpacking
print("## 4. Using `*` for Extended Unpacking")
print("Expected Output:")
print("1")
print("[2, 3, 4]")
print("5")
print("-" * 80)
# 5. Ignoring Unwanted Values
print("## 5. Ignoring Unwanted Values")
print("Expected Output:")
print("1 3")
print("10 50")
print("-" * 80)
# 6. Assigning Same Value to Multiple Variables
print("## 6. Assigning Same Value to Multiple Variables")
print("Expected Output:")
print("100 100 100")
print("-" * 80)