Tutorials |
|
Sno | Subjects |
---|---|
1 | Software Engineering (SE) |
2 | Analysis Design of Algorithm (ADA) |
4 | Basic Computer Engineering |
5 | Database Management System |
6 | Data Structure |
What is Python ?
Python is a general purpose , encrypted, high level and open source language. It is one of the simple programming language used to write codes for computer program. It is a general purpose , high level , interpreted language. It is created by Guido Van Rossum in 1989 with the thinking that everyone can easy to write and understand. In python for writing code indentation is used in the place of cursory braces. It is very powerful language . We can develop any application by using python in very less time.
Features of Python ?
- SIMPLE :It is very simple language. It can easily read and write. For programming in python their is no need to know about any programming knowledge or experience.
- INTERPRETED LANGUAGE :In other language like C, C++, JAVA etc need to compile before running or executing. Python can not be compiled. Python code are interpreted line by line at run time. That's why it is known as interpreted language. This language become slow compare to other language.
- PLATFORM INDEPENDENT : It can easily run on Windows, Linux, MAC operating system. Python code written in any operating system can run on another operating system. That's why it is known as platform independent.
- EXTENSIBLE LANGUAGE :It means if we want to add any program code of different language such as C,C++,JAVA etc than python will allow to do.
- LARGE AND POWERFUL LIBRARY :Large and powerful library are available in python. Modules and packages are available in python for rapid development. For different task such as GUI, Web Development, Database Connection separate modules are available so no need to write code for different task.
How to install Python
Step- 1:
Step- 2:
Step- 3:
Step- 4:
Step- 5:
Step- 6:
Step- 7:
Best Pythom IDE for Python Development
Data Type in Python
Data Type in python are classified into following:
- Numeric
- Integer
- Float
- Complex Number
- Boolean
- Sequence Type
- List
- Tuple
- String
- Range
- Set
- Dictionary
Numeric Data Type
print(3) #return 3
print(3.435) #return 3.435
print(-5) #return -5
print(2+5) #return 7
print(2+5.2) #return 7.2
print(4%2) #return 0
#define variables
first_num=2
second_num=3
print(first_num*second_num) #return 6
print(str(first_num*second_num) + " is multiply of 2 and 3") #convert number into string
3.435
-5
7
7.2
0
6
6 is multiply of 2 and 3
data_numeric=4
print((data_numeric))
data_numeric=4.5
print((data_numeric))
data_numeric=5+6j
print((data_numeric))
a=5
b=6
print(a<b)
print(a>b)
a=5
b=6
print(int(a<b))
print(int(a>b))
int_numeric=5
float_numeric=6.5
print(int(float_numeric))
print(float(int_numeric))
int_numeric_r=5
int_numeric_i=6
print(complex(int_numeric_r,int_numeric_i))
Output:
(5+6j)
Sequence Data Type
um_list=[2,3,5,6,10]
print(num_list)
print(type(num_list))
data_tuple=(12,20,10,5,8,7)
print(data_tuple)
print(type(data_tuple))
#For next line use \n
print("Name is shailu \nAge is 40")
name="shailu" # variable name
print(name.upper()) # return SHAILU
print(name.upper().isupper()) # return True
print(len(name)) # return length of string 6
print(name[0]) # return first character of string i.e s
print(name.index("a")) # return index of a i.e 2
print(name.replace("shailu","chailu")) # replace shailu to chailu
Age is 40
SHAILU
True
6
s
2
chailu
print(range(2,10))
print(list(range(2,10)))
print(range(2,10,2))
print(list(range(2,10,2)))
[2, 4, 6, 8]
Set Data Type
data_set={12,20,10,5,8,7}
print(data_set)
print(type(data_set))
Dictionary Data Type
dist={'1':'C-language','2':'ADA','3':'C++','4':'Python'}
print(dist)
# comment: get index or keys
print(dist.keys())
# comment: fetch values
print(dist.values())
# comment: fetch value by index or key
print(dist['2'])
# comment: get value by index or key
print(dist.get('3'))
dist_keys(['1', '2', '3', '4'])
dist_values(['C-language', 'ADA', 'C++', 'Python'])
ADA
C++
Variables in Python
We will start with very basic example
let we take two variable and ADD them such as
a=2
b=3
print(a+b)
Output
Hell friends,It is very easy to design HTML page.HTML is Hyper Text Markup Language.It is very helpful for beginners. I will demostrate how we start designing simple HTML Page. There are so many HTML editor are available for designing HTML pages. No matter which editor is used. The most common editor is Notepad , Notepad++ , Sublimetext.Let we start with HTML code.
CSS BASIC | ||
CSS:
h1 {font-family: Georgia, sans-serif;} |
||
CSS: For Body Tag body {margin: 20px;} |
||
CSS: For Combine Elements
h1, h2, h3, h4, h5, h6 { |
||
CSS: FOR Comments /* This is a comment */ |
||
CSS: FOR Create Class
.container{ HTML: FOR Call CSS Class
<div class="container"> |
||
CSS: FOR Create ID
#container{ HTML: FOR Call CSS ID
<div ID="container"> |
||
CSS SELECTORS | ||
There are many different types of CSS selector that allow you to target rules to specific elements in an HTML document. CSS selectors are case sensitive, so they must match element names and attribute values exactly. Universal Selector Applies to all elements in the document Type Selector Matches element names Class Selector Matches an element whose class attribute has a value that matches the one specified after the period (or full stop) symbol ID Selector Matches an element whose id attribute has a value that matches the one specified after the pound or hash symbol. Child Selector Matches an element that is a direct child of another Descendant Selector Matches an element that is a descendent of another specified element (not just a direct child of that element) Adjacent Sibling Selector Matches an element that is the next sibling of another. General Sibling Selector Matches an element that is a sibling of another, although it does not have to be the directly preceding element. |
||
MIN-WIDTH AND MAX-WIDTH , MIN-HEIGHT AND MAX-HEIGHT | ||
By using max-width and min-width , size of website can be easily adjust according to browser width size. CSS: td.text { Call in HTML Code: <td class="text">Call text css in td of table to manage text in td according to screen size.</ td> |
||
By using max-height and min-height, size of website can be easily adjust according to browser height. CSS: p { Call in HTML Code: <p>Call this css implicitly when using p tag and adjust their height.</ p> |
||
INHERITANCE | ||
If you specify the font-family or color properties on the <body> element, they will apply to most child elements. This is because the value of the font-family property is inherited by child elements. CSS:
Call in HTML Code:
|
||
CSS FOR FOREGROUND COLOR | ||
The color property allows you to specify the color of text inside an element. CSS:
|
||
CSS FOR BACKGROUND COLOR | ||
CSS treats each HTML element as if it appears in a box, and the background-color property sets the color of the background for that box. CSS:
|
||
CSS FOR OPACITY | ||
CSS3 introduces the opacity property which allows you to specify the opacity of an element and any of its child elements. The value is a number between 0.0 and 1.0 (so a value of 0.5 is 50% opacity and 0.15 is 15% opacity). CSS:
|
||
CSS FOR MARGIN | ||
CSS: BASIC FORMAT
There are Three choices of values for the margin property. |
||
CSS FOR PADDING | ||
Padding is the Space between the border of an HTML element and the content within it. It is just like Margin but there is no "auto" value, and negative values cannot be declared for padding. CSS: BASIC FORMAT
There are Two choices of values for the Padding property. |
||
CSS FOR TEXT PROPERTIES | ||
Text is important part of website so we must manage text using css. Text contain following properties:
∗ Color CSS: Color
color: value; CSS: Letter Spacing
letter-spacing: value; CSS: Text Align
text-align: value; CSS: Text Decoration
text-decoration: value; CSS: Text Indent
text-indent: value; CSS: Text Transform
text-transform: value; CSS: White Space
white-space: value; CSS: Word Spacing
word-spacing: value; |
||
CSS FOR FONT PROPERTIES | ||
Font is important part of website so we must manage Font of text using css. Font contain following properties:
∗ Font CSS: Font
General formate of font: CSS: Font-Family
Font-Family: value; CSS: Font Size
Font Size: value; CSS: Font Style
font style: value; CSS: Font Variant
font variant: value; CSS: Font Weight
font weight: value; |
||