Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

python-Basics Functions

First Python Program for starting

print("Hello, myself")

This code will print "Hello, myself"

Variables in Python

Syntax for Variable Assignment:

x = 5  # Assigning an integer value to the variable x
y = "Hello"  # Assigning a string value to the variable y

Data type

"15"
x = int("15") # convert string to integer - 15
y = float("15") # convert string to float number - 15.0

Arithematic operators

  • + (Addition)
  • - (Subtraction)
  • * (Multiplication)
  • / (Division)
  • // (Floor Division)
  • % (Modulus)
  • ** (Exponentiation) Using these operations, we can make the

Assignment Operators

Assignment operators are used to assign values to variables:

#Operator Examples
=	  x = 5	x = 5	
+=	x += 3	x = x + 3	
-=	x -= 3	x = x - 3	
*=	x *= 3	x = x * 3	
/=	x /= 3	x = x / 3	
%=	x %= 3	x = x % 3	
//=	x //= 3	x = x // 3	
**=	x **= 3	x = x ** 3	
&=	x &= 3	x = x & 3	
|=	x |= 3	x = x | 3	
^=	x ^= 3	x = x ^ 3	
>>=	x >>= 3	x = x >> 3	
<<=	x <<= 3	x = x << 3	
:=	print(x := 3)	x = 3
print(x)
>>

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages