PF Assignment 1
PF Assignment 1
Explanation: As experimented above I left out one quotation mark which resulted in a syntax
error. As we progress through our academics it is important to learn from our little mistakes just
like I left one quotation mark, in future when I will make projects or write code, I will carefully
proofread the syntax before printing the output.
Explanation: In the above example we ran two codes with * and ** operators in which *
operator is used to multiply the values and ** operator is exponentiation which raises number to
a power but in above example both of the answers are same, Referring to the book it used the
exponentiation operator with an addition operator which raised the output of multiplied values
with the value 4 as an example below to which the output was 8 different from the one we
performed earlier:
Input b3: >>2**2+4
Output: >>8
Explanation: No, we cannot print the integer 09 in python3 because leading zeros are not
permitted in the environment but if we use 00 integer in the environment it will print the syntax
answer for example below:
Input c2: >>00
Output: >>0
PART 2
Lessons learned from the experiments of part 2: The lessons I learned from the part 2 is by
running different codes with different contexts like multiplying my age with the integer 2 (20*2),
as I will progress through the programming fundamentals course the coding parameters will
become difficult and descriptive with each unit, so running one line codes as a starter will help
me to understand the technical terms and syntaxes better. For the output two in which I printed
the name of the city, country and continent where I live helped me to better understand the
syntax because I didn’t run each category separately instead it summed up in one print parameter
and displayed the output correctly >>print ('Karachi, Pakistan, Asia'). The third input in which
it was asked to mention the starting to end day of the final exam of this term I learned that an
integer can also be used within a string of words to output our syntax without getting an error in
the result >> print ('5 June 2025 to 8 June,2025'). And the last output in which it was asked to
print the temperature of my country the lesson I learned from it is same as output three that I can
use integers within a string >> print ('31-degree Celsius').
Reference:
Downey, A. (2015). Think Python: How to think like a computer scientist. Green Tree Press.
https://greenteapress.com/thinkpython2/thinkpython2.pdf