Saturday, 23 July 2016

Classes and objects In Python

Class is just a blueprint for an object . Let’’s suppose class is just  like a  sketch (prototype)  of a house . There is a real life example of class , like we  want to build  a house , and  this house  have floors, doors, windows, rooms, etc . Now we can  use the same structure   for   many houses .

So house is just a object that means we can create  many houses having same structure . So in case of programming  we can create many objects of a class .


Syntax for declaring class :

class Class Name:
    “documentation string this is optional”
    class_suite

The class has a documentation string , which  we can access using dot(.) notation . For accessing the documentation string we will use class name.__doc__ ,


   class_suite  that means this will contain  all functions, data members and data attributes .


       For example:

class  Student:
     ‘This is the base class for all  students”
     student_count=0
     def __init__(self,name , rollno):
         self.name=name
         self.rollno=rollno
         Student.student_count +=1
     
    def  showcount(self):
        print “Total Student %d” % Student.student_count

    def showemployee(self):
        print “Name : “,  self.name,  “, RollNumber : “, self.rollno
Softcrayons Tech Solutions provide best core and advance python training institute.

Friday, 22 July 2016

How the extrude tool works in AUTO – CAD

As we know that Auto –cad is a popular drafting software and used for 2D work.
But with 2D it have some 3D tool also and the extrude is one of all that.
So the extrude tool in auto cad works as a 3D modeling tool  which mean  it convert a 2D drafted sketch into the 3D Model .
To learn the extrude tool of Auto –cad we should follow the following steps.
  1. Open the cad software.
  2. Now draw a 2D sketch  as given below:-


  1. Now, open the 3D window of Auto-cad and chose the extrude tool.
  2. After opening the extrude tool the following option must be open:- extrude height, path and taper angle.
  3. Extrude height mean a toll which convert a 2D sketch into the 3D.
  4. Path means extrude of the sketch follow such path which is given during extrude.
  5. Taper angle mean to give a taper angle to the sketch to extrude for the purpose of direction.
  6. So in this way extrude is complete.
fig. shows a 3D model 


Softcrayons tech solutions offers auto cad 2D training in ghaziabad. 

How to draw a chair model in Auto-Cad

Auto cad is very popular drafting software. It has a high accuracy in drafting .that all because of its variety of tools. Auto cad has a number of tools in its draw bar and modify bar that will helping to draw a number of sketches.
So, today we are going to discuss that how to draw the chair model in AUTO-CAD.
To draw a 2D chair model in auto cad we should follow the following steps:-
  • Open the cad software and enter into the 2d window of auto cad.
  • Now set the drafter and sheet size for the drawing.
  • Take the sketch of the chair model and read all the dimensions carefully.
  • Now take line tool and start to draw the base line of the sketch.
  • Step by step according to requirement of command draw all parts of the chair model.
  • Then draw the model of table.
  • Now start to give the drafting to each part of chair model as according to drafting method.
  • Add the verity of colors as per requirement.
  • Now your design is ready to use.
  • You can save it or take a print of your drawing as per requirement
  • You can also mail your drawing, while to save in into different format (as per                 requirement). 
Softcrayons tech solutions is a best auto cad training institute in Ghaziabad.

HELIX IN 3D

Now let’s we discuss how helix is working in 3D.
A 3d window of auto cad is the window in which 2d sketch are converted into the 3d.
It contains the various modules like Part modeling, Surface modeling, and Wireframe meshes, rendering etc.
To learn how it is work lets we follow the following steps:-
Open the 2d window of the auto cad.
Go to draw bar and select the helix tool.
Now enter the centre point of the helix(0,0)
Enter the radius of the first circle of the helix.
Enter the no of turns of spring.
Enter the height of spring.
Now, enter the second radius of the helix.
Now 2D sketch of helix is ready.
To convert the 2d frame of helix into 3d we have:-
  • Open 3d window of auto cad.
  • Keep the helix in top plane. (Make sure that you sketch the 2d helix in front plane).
  • Now took the circle command and draw a circle at right side of the turn of helix (keep note that the dia of circle is not more than the pitch of helix.
  • Now go to sweep toolbar of the 3D window and select the circle of helix as a profile.
  • Select helix as a path
  • Automatically a 3D spring is created.
Softcrayons tech solutions is a best AUDTO CAD 3D institute in Ghaziabad.



How helix tool is working in AUTO CAD 2D

An AUTO CAD is an automatically computer aided design software.
It is basically used for drafting purposes.
Now day’s auto cad is as much popular software in all field of mechanical engineering (at small scale, medium scale and large scale).
So let’s discuss about the draw bar tool of cad i.e. HELIX

IN 2D

A helix is spring type section which is very interesting to construct
To draw helix we should follow the following steps:-
  • Open the 2D window of the auto cad.
  • Go to draw bar and select the helix tool.
  • Now enter the center point of the helix(0,0)
  • Enter the radius of the first circle of the helix.
  • Enter the no of turns of spring.
  • Enter the height of spring.
  • Now, enter the second radius of the helix.
  • Change the view as a isometric.
  • So this will complete the helix option in 2d. 


Softcrayons Tech solutions offers best job oriented training on AUTO CAD.


Break keyword in python

break statement is used in python  to terminate the loop . Loops basically iterate a block of code untill condition is become false , but sometimes we want to terminate the current iteration or whole loop without checking the condition . The most common use of break statement is when some external condition is triggered and requiring a hasty exit from a loop . We can use the break keyword or statement in both loops that is while and for .

Syntax of break keyword in python:

break

>>> list1=[1,2,3,4,5,6,7,8]
>>> for a in list1:
...     if  a==6:
...         break
...     print a
...
1
2
3
4
5
>>>

Second example of break keyword with while loop: -

var1 =20
while var1> 0:
    print 'Current value :', var1
    var1=var1 -1
    if var1==8:
        break
print 'bye'

output would be 

Current value : 20
Current value : 19
Current value : 18
Current value : 17
Current value : 16
Current value : 15
Current value : 14
Current value : 13
Current value : 12
Current value : 11
Current value : 10
Current value : 9
bye
softcrayons tech solutions provide best job oriented training on python course.

User defined functions in python

Function  that we define ourselves to perform a specific task  are called user defined functions .
These functions are created using def keyword , inside the function we write any statement with the indentation (4 spaces ) . The def keyword  , then function name and round brakets after that .

When we need to call our function we have to use function name with round brackets(). When we will call the function , statement of  function body will be executed . This will be not be executed untill we call that .

For exapmle:
def  animal():
    print “Hi  Guys welcome to the python world”
animal()

>> output would be :   Hi   Guys welcome to the python world

Advantages of user defined functions

1.  User defined functions help to decompose a large programs into small segments .

2.  When we are working on large project , that time  this divide the workload  by making small – small functions .

# Find the below exapmle for user defined  function

def addition(x, y):
    add=x+y
    return add
num1=float (input(“Enter the number  1: “))
num2=float(input(“Enter the number 2: “))
print (“sum is “ ,  addition(num1, num2))

output would be ;
>> Enter the number 1:    30.0
>> Enter the numberb 2:   20.5
>> sum is  50.5

* In the above example addition() is the user defined function and intput(), print() and float() are the builtin functions of python .
softcrayons tech solutions is a best python training institute in vasundhra ghaziabad.