Skip to main content

ads1

Chapter :- 2 Getting Stared with Python

 Chapter :- 2 Getting Stared with Python


Summary

Python was developed by Guido Von Rossum in February 1991.

Python offers following advantages

easy to use , expressive , free and open source, complete ,cross-platform

Python also has these limitations: 

Not the fastest language , Not strong on Type-binding ,Lesser libraries than C, Java, Perl.

In Python, one can work in two different ways: (1) Interactive mode, (2) Script mode.

Popular Python distributions are CPython (default), Anaconda distribution etc. 

Popular Python IDEs are Python IDLE, Spyder IDE, Jupyter Notes, Pycharm IDE etc.

Interactive mode is suitable for testing code.

Interactive mode does not save commands in form of a program and also, output is sandwiched between commands.

Script mode is useful for creating programs and then run the programs later and get complete output

Python is an interpreted language.

Python's interactive interpreter is also called Python Shell.


Answer the Following Question..........

(1). Who developed Python Programming Language ?

SOLUTION. Guido Van Rossum in 1990s developed Python programming language.

(2). Is Python an Object Oriented language? 

SOLUTION. Yes, Python is an Object Oriented language.

(3). Python is an interpreted high level language". What does it mean to you?

SOLUTION. Python is a high level language' means it is programmer-friendly fr., easy to program and comprehend. 'Python is an interpreted language' means it requires an interpreter (not compiler) to execute its code line by line-one statement at a time.

(4). What does a cross platform language mean?

SOLUTION. A cross platform language means it can run well on variety of platforms like Windows, Linux/Unix, Macintosh etc. etc.

(5). Python is a Free and Open Source language. What do you understand by this feature?

SOLUTION. It means to download Python, one needs not pay anything, because it is Free. And its source-code is also available, which can be modified/improved etc., because it is open-source. 

(6). What is the difference between interactive mode and script made in Python?

SOLUTION. In interactive mode, instructions are given in front of Python prompt (eg. >>> or In[]prompts) in Python Shell. Python carries out the given instruction and shows the result there itself. In script mode, Python instructions are stored in a file generally with .py extension and are executed together in one go as a unit. The saved instructions are known as Python script or Python program.


Class 11 Chapter 2 Getting started with Python. 


Link to download Chapter :-2 





 

ads2

Popular posts from this blog

11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following:

    11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following: Basic Salary <= 10000 : HRA = 20%, DA = 80% Basic Salary <= 20000 : HRA = 25%, DA = 90% Basic Salary > 20000 : HRA = 30%, DA = 95% Static Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     if(basic <=10000)     {         da = basic * 0.8;         hra = basic *0.2;     }              else if(basic <=20000)     {         da = basic * 0.9;         hra = basic *0.25;     }     else     {         da = basic * 0.95;         hra = basic * 0.3;     }     gross = basic + da + hra;     System.out.println("The Gross Salary is :-"+gross);     } } Output :-  Dynamic Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     Scanner in = new Scanner(System.in);     System.out.println("Enter the Basic Salary

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise or class wise.

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise  or class wise. Solution :-   # x-axis is shows the subject and y -axis # shows the markers in each subject # import pandas and matplotlib  import pandas as pd  import matplotlib.pyplot as plt # Simple Line Chart with setting of Label of X and Y axis, # title for chart line and color of line  subject = ['Physic','Chemistry','Mathematics', 'Biology','Computer'] marks =[80,75,70,78,82] # To draw line in red colour plt.plot(subject,marks,'r',marker ='*')     # To Write Title of the Line Chart plt.title('Marks Scored') # To Put Label At Y Axis plt.xlabel('SUBJECT')           # To Put Label At X Axis plt.ylabel('MARKS')             plt.show() Output :- 

24.Create a Data Frame quarterly sales where each row contains the item category, item name, and expenditure. Group the rows by the category and print the total expenditure per category.

24.Create a Data Frame quarterly sales where each row contains the item category, item name, and expenditure. Group the rows by the category and print the total expenditure per category. import pandas as pd  # initialize list of lists data = [['CAR','Maruti',1000000],['AC','Hitachi',55000],['AIRCOLLER','Bajaj',12000], ['WASHING MACHINE','LG',15000],['CAR','Ford',7000000],['AC','SAMSUNG',45000],['AIRCOLLER','Symphony',20000],['WASHING MACHINE','Wirlpool',25000]] Col=['itemcat','itemname','expenditure'] # Create the pandas DataFrame qrtsales = pd.DataFrame(data,columns=Col) # print dataframe.  print (qrtsales) qs=qrtsales.groupby('itemcat')  print('Result after Filtering Dataframe')  print(qs['itemcat','expenditure'].sum()) Output :-