__author__ = "Narendra Boyina"
# -----------------------------------------------------------------------------
# Copyright (c) 2024 BR Technologies PVT LTD
#-----------------------------------------------------------------------------
""" Python Definition:
==================
Python is a very powerful general-purpose, interpreted, interactive,
object-oriented, open source, high-level scripting and programming language
that highlights code readability and
enables developers to use fewer lines of code
"""
"""
Basic syntax & Commenting
Basic syntax
============
1. Indentation used in Python to delimit blocks.
2. All the statements within the same block must be indented the same amount.
3. The header line for compound statements, such as if, while, def, and class should terminated with a colon (:)
"""
"""
Within double quotes symbol, if user provided anything it will be printed as it is on the console..
Except escape sequence characters (\n ==> new line \t ==>4 spaces)
if any escape sequence character presents with in double quotes,
then that escape sequence character will be replced with it's property
"""
# Printing to the console (output screen)
a = "Narendra"
# print(a)
# print("**** I Love you Nanna ****", a)
# print("I Love you Nanna and\tAmma")
# print("I Love you Nanna and\nAmma")
#
# a = input("Enter age")
# print(a, type(a))
# Reading keyboard/user input
# a = float(input("enter 10th class percentage: "))
# print(a, type(a))
#
# a= int(float(input("enter 10th class percentage: ")))
# print(a, type(a))
# b = input("enter marks")
# print(b, type(b))
# a = input("enter 10th class percentage: ")
# b = float(a)
# c = int(b)
# print(c, type(a))
# b = int(input("enter marks"))
# print(b, type(b))
# c =float((input("enter percentage")))
# print(c, type(c))
#
# c =int(float((input("enter percentage"))))
# print(c, type(c))
# a = 10
# print(type(a))
"""
Commenting lines in 3 ways
1. Single line comment
2. Multi lines comment
3. In line comments """
# print("Narendra")
"""
print("Name: Narendra")
print("Qualification: M.tech")
print("Total Experience: 8.5 years")
print("only python experience 5 years")
"""
# print("Narendra & Surendra") # we are brothers
import keyword # importing module (library)
print(keyword.kwlist) # it will print all keywords supported by particular python version
"""
#Variables & Numbers
=====================
#Variables (declaration & Initialisation)
=========================================
1. Python is dynamically typed. You can not need to declare variables!
2. The declaration happen automatically when you assign a value to a variable
3. Variables can change type, simply by assigning them a new value of different type
4. Python allows you to assign a single value to several variables simultaneously
5. You can also assign multiple objects to multiple variables.
Numbers:
=======
1. Numbers are immutable objects in Python that cannot change their values.
2. There are 3 built-in data types for numbers in Python 3
Integer (int)
Floating-point numbers(float)
Complex numbers: <real part> + <imaginary part> (Not used much in programming)
print("NarendraPython,")
"""
# In python we can perform multiple operations on numbers (integers & floats)
import math
x = 5
# print(math.factorial(x)) # 120
# print(math.log(x)) # 1.6094379124341003
# print(math.exp(x)) # 148.4131591025766
x = 5.4
# print(math.ceil(x)) # gives (>=x integer value) 6
# if x<10:
# print("Yamuna")
# print("vijayalakshmi")
# print(1.2)
# name = input("Enter name: ")
# print(name,type(name))
# a = int(input("Enter age: "))
# print(a)
# print(type(a))
No comments:
Post a Comment