admin (19)

Taking Input in Python

input () function first takes the input from the user and converts it into a string. The type of the returned object always will be <class ‘str’>. It does not evaluate the expression it just returns the complete statement as String. # Python program showing…

Continue reading...

Practise Programs for Day 1

1.Program to take 2 strings and print them 2.Program to take 1 integer, 1 string , 1 float and print values & type of data 3.Program to take 2 strings and print with sep=”-“ and also print with end=”!!” 4.Program to take 2 integers and…

Continue reading...

Strings

A string is a sequence of characters. Python treats anything inside quotes as a string. This includes letters, numbers, and symbols. Python has no character data type so single character is a string of length 1. s1 = "Hello" s2 = 'wor'd' print(s1,s2) Multi line…

Continue reading...

Numbers

In Python, numbers are a core data-type essential for performing arithmetic operations and calculations. Python supports three types of numbers, including integers, floating-point numbers and complex numbers. Here’s an overview of each: x = 5 # A positive integer y = -23 # A negative…

Continue reading...

List

In Python, a list is a built-in dynamic sized array (automatically grows and shrinks). We can store all types of items (including another list) in a list. A list may contain mixed type of items, this is possible because a list mainly stores references at…

Continue reading...