tute_lab_week5.pdf - Tutorial and Laboratories Week 5 Tutorial This week we are starting Introduction to Programming using Python therefore this

tute_lab_week5.pdf - Tutorial and Laboratories Week 5...

This preview shows page 1 - 2 out of 10 pages.

Tutorial and Laboratories Week 5 Tutorial This week we are starting Introduction to Programming using Python , therefore this week’s tutorial class will focus on basics of Python programming such as how to write to standard output, basic data types, variable and some basic mathematical and string operations. In Python we can write into the standard output by using print function. Please note that print function expects its arguments to be surrounded by parentheses. The print function can print an arbitrary number of values ("value1, value2, ..."), which are separated by commas. A print call is ended by a newline. A variable is a way of referring to a memory location used by a computer program. In Python, variable name begins with letter or underscore _ and can only consist of letters, numbers, underscores. Variable names are case sensitive, that means Apple and apple will be considered as two different variables. A variable is created the first time it is used in an assignment statement. A variable must first be created using an assignment statement before it can be used in an expression. You cannot use a Python reserved word to name your variables. The basic mathematics operators are: Operator Description +, - Addition, Subtraction *, % Multiplication, Modulo / Division results of the division is always float //
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read all 10 pages?

  • Three '17

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors