Week 4A Lab - Python Input and Basic Operators PDF
Document Details
NU Dasmariñas
Joevan U. Sacdalan
Tags
Summary
This document is lecture notes for a Python programming course, covering user input and basic operators. It explains how Python handles user input and introduces various arithmetic operators. The notes cover addition, subtraction, multiplication, division, modulus, exponentiation, and floor division. It also introduces assignment operators and their use in Python programming.
Full Transcript
NU - DASMARIÑAS Python Input and Basic Operators Introduction to Computing Week 3 1st Term 2024 - 2025 Joevan U. Sacdalan School of Engineering, Computing, and Architecture User Input Python allows for user input. Python uses the input() method. Python stops executing when it comes...
NU - DASMARIÑAS Python Input and Basic Operators Introduction to Computing Week 3 1st Term 2024 - 2025 Joevan U. Sacdalan School of Engineering, Computing, and Architecture User Input Python allows for user input. Python uses the input() method. Python stops executing when it comes to the input() function, and continues when the user has given some input. Python Operators Operators are used to perform operations on variables and values. Python divides the operators in the following groups: Arithmetic operators Assignment operators Comparison operators Logical operators Identity operators Membership operators Bitwise operators Arithmetic Operators Arithmetic operators are used with numeric values to perform common mathematical operations Addition Subtraction Multiplication Division Modulus Exponentiation Floor Division Format Float (limit decimal places) Assignment Operators Assignment operators are used to assign values to variables. Assignment Addition Assignment Subtraction Assignment Multiplication Assignment Division Assignment Modulus Assignment Exponentiation Assignment Floor Division Assignment