*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13
4:03:13
4:03:13
AM1
AM1
AM1
ofof8Page
of8Page
8Page
1CS
1CS
1CS
1101-01
1101-01
1101-01
- AY2026-T2
- AY2026-T2
- AY2026-T2
Programming
Programming
Programming
Assignment
Assignment
Assignment
Unit
Unit
Unit
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1 1of1of8of8 8
____________________________________________________________________________
______##############
CS 1101-01 - AY2026-T2 / Programming Assignment Unit 1
CS 1001 - Programming Fundamentals
Part 1: Learn From My Mistakes
Question a: Printing my name
Code:
print("Benjamin Adebayo") # Correct
print('Benjamin Adebayo) # Missing one quote (will cause SyntaxError)
print(Benjamin Adebayo) # Missing both quotes (will cause NameError)
Explanation:
When printing text, Python requires quotes. Missing one quote causes SyntaxError: EOL
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13
4:03:13
4:03:13
AM1
AM1
AM1
ofof8Page
of8Page
8Page
1CS
1CS
1CS
1101-01
1101-01
1101-01
- AY2026-T2
- AY2026-T2
- AY2026-T2
Programming
Programming
Programming
Assignment
Assignment
Assignment
Unit
Unit
Unit
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1 1of1of8of8 8
, *@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13
4:03:13
4:03:13
AM2
AM2
AM2
ofof8Page
of8Page
8Page
2CS
2CS
2CS
1101-01
1101-01
1101-01
- AY2026-T2
- AY2026-T2
- AY2026-T2
Programming
Programming
Programming
Assignment
Assignment
Assignment
Unit
Unit
Unit
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1.pdf2026/10/23Page
2 2of2of8of8 8
____________________________________________________________________________
______##############
while scanning string literal, while missing both quotes treats it as a variable, giving
a NameError. Strings must always be enclosed in quotes to be recognized correctly.
Question b: Difference between * and ** operators
Code:
result_mult = 5 * 3
result_exp = 5 ** 3
print("5 * 3 =", result_mult)
print("5 ** 3 =", result_exp)
Explanation:
* multiplies numbers normally, while ** raises the base to the power of the exponent.
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13
4:03:13
4:03:13
AM2
AM2
AM2
ofof8Page
of8Page
8Page
2CS
2CS
2CS
1101-01
1101-01
1101-01
- AY2026-T2
- AY2026-T2
- AY2026-T2
Programming
Programming
Programming
Assignment
Assignment
Assignment
Unit
Unit
Unit
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1.pdf2026/10/23Page
2 2of2of8of8 8
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13
4:03:13
4:03:13
AM1
AM1
AM1
ofof8Page
of8Page
8Page
1CS
1CS
1CS
1101-01
1101-01
1101-01
- AY2026-T2
- AY2026-T2
- AY2026-T2
Programming
Programming
Programming
Assignment
Assignment
Assignment
Unit
Unit
Unit
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1 1of1of8of8 8
____________________________________________________________________________
______##############
CS 1101-01 - AY2026-T2 / Programming Assignment Unit 1
CS 1001 - Programming Fundamentals
Part 1: Learn From My Mistakes
Question a: Printing my name
Code:
print("Benjamin Adebayo") # Correct
print('Benjamin Adebayo) # Missing one quote (will cause SyntaxError)
print(Benjamin Adebayo) # Missing both quotes (will cause NameError)
Explanation:
When printing text, Python requires quotes. Missing one quote causes SyntaxError: EOL
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13
4:03:13
4:03:13
AM1
AM1
AM1
ofof8Page
of8Page
8Page
1CS
1CS
1CS
1101-01
1101-01
1101-01
- AY2026-T2
- AY2026-T2
- AY2026-T2
Programming
Programming
Programming
Assignment
Assignment
Assignment
Unit
Unit
Unit
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1 1of1of8of8 8
, *@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13
4:03:13
4:03:13
AM2
AM2
AM2
ofof8Page
of8Page
8Page
2CS
2CS
2CS
1101-01
1101-01
1101-01
- AY2026-T2
- AY2026-T2
- AY2026-T2
Programming
Programming
Programming
Assignment
Assignment
Assignment
Unit
Unit
Unit
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1.pdf2026/10/23Page
2 2of2of8of8 8
____________________________________________________________________________
______##############
while scanning string literal, while missing both quotes treats it as a variable, giving
a NameError. Strings must always be enclosed in quotes to be recognized correctly.
Question b: Difference between * and ** operators
Code:
result_mult = 5 * 3
result_exp = 5 ** 3
print("5 * 3 =", result_mult)
print("5 ** 3 =", result_exp)
Explanation:
* multiplies numbers normally, while ** raises the base to the power of the exponent.
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13
4:03:13
4:03:13
AM2
AM2
AM2
ofof8Page
of8Page
8Page
2CS
2CS
2CS
1101-01
1101-01
1101-01
- AY2026-T2
- AY2026-T2
- AY2026-T2
Programming
Programming
Programming
Assignment
Assignment
Assignment
Unit
Unit
Unit
1.pdf2026/10/23Page
1.pdf2026/10/23Page
1.pdf2026/10/23Page
2 2of2of8of8 8