Learn practical skills, build real-world projects, and advance your career

SVIS-py

This notebook is an introduction to Python for absolute beginners. This notebook covers the following topics:

  • Print Statement
  • Data Types
  • Indexing
  • Variables
  • Type Conversion
  • Input statement
  • Arithmetic Operations
  • Comments
  • Conditional Statements
  • For / While Loops

Print Statement

print: The print function is used to display information. It takes one or more inputs, which can be text (within quotes, e.g., "this is some text"), numbers, variables, mathematical expressions, etc.

print('Hello world')
Hello world
print(10101.09356)
10101.09356

Data Types

Different types of data that you might encounter are:

  • str: A sequence of characters. This data type is usually denoted by single or double quotes. For eg: 'hello', '101'
  • int: Normal integers come under the class of int. For eg: 100184, 0
  • float: Decimal point numbers come under the class of float. For eg: 103.8906, 9.0
  • list: An ordered sequence of elements. This data type is usually denoted by square brackets. These data types are mutable, meaning they can be changed. For eg: ['hello', 'world', '!'], [100, 864.21, 'bye']
  • tuple: These are similar to lists with some key differences. This data type is usually denoted by parenthesis. These data types are immutable meaning they cannot be changed. For eg: ('hello', world', '!'), (100.00, 0.14, 101010101, 'bye')