Lab 1

In this lab, you will learn to use python to understand variables, expressions and statements. First find and open the application, Python. When Python is opened, type width = 17. Then press enter because if you continue typing and without press enter, you will get an error on Python. After you press enter, type height = 12. Press enter again, then type delimiter = ‘.’ and press enter. These are inputs that will give you an output. Now to test it out, type width/2 and press enter. Then repeat the steps but this time, type width/2.0. You will see both answers will be slightly similar. Repeat the process but type height/3 instead. As an output, you should get 4. If you type 1 + 2 * 5 then enter, you’ll get an answer of 11. But if you type delimiter * 5, you’ll get something like this, ‘…..’ .

Code:

width = 17
height = 12
delimiter = ‘.’

width/2
 width/2.0
 height/3
1 + 2 * 5
delimiter * 5

lab 1

 

https://openlab.citytech.cuny.edu/tlai-eportfolio/

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *