Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Python Programming LECTURE NOTES, Lecture notes of Programming Languages

Python Programming Lecture NOTES

Typology: Lecture notes

2022/2023

Available from 01/21/2024

sahil-ajudiya
sahil-ajudiya 🇮🇳

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Enrolment Number:
PARUL UNIVET{StTY
FACULTY OF ENGTNEERING & TECHNOLOGY
B.TECH MtD SEM EXAMINATION
3"d SEMESTER
ACY-2022-23
Python Programming (203 10521 1)
Date: 0510812022 Time: 2.30 PM to 4.00 PM
Sr. No.. Marks
Q.l (A) One line Questions 05
1. Define indentation in python.
2. How can we conveft a string to an int in python?
. 3. What will be the output of the following code snippet?
print(type(5 // 2))
print(type(5 / 2))
4. Hor,v can \.ve comment in python program?
" 5. What is an identifier?
(B) CompLrlsory Question 05
1. '*' operator is called operator when used with strings.
2. What will be the value of the fbllowing Python expression?
5-2+3%6
3. lcn() retLrrns oFstring.
4. Define Fr-rnction.
5. \,Vhy do we Lrse break keyr.vord?
Q.2 Atternpt any four(Short Questions) tz
(l) What are operators'? tixplain arithrnctic opdrators.
(2) F)xplain recursion r,vith suitable ei:iimple.
(3) Explain about string slioing with exanrples.
(4) What is the outpLrt of the ibllor,ving code snippet?
prinr(2+*3 + (19 ll 6)**(l + I))
(5) Define lambda furrction with suitable example.
Q.3 Attempt any two 08
(l) What are applications oIPytho;'r Programnting? Which python iCes are used by
yoLr?
(2) What is a user-defined firrrction'? Explairr with suitable examples
(3) Flxpiain if'-else conditional [rlocir. Writr: a python pro{rarn that reads a number
and chccl<s if'the no is positivu ()r nugativo.
Q.4 (A) Ex;ilain the tlor,v ot''tbr' loop and 'r,vhile' ioop. Writc a python program to print 05
sur.Il ol'even ntltub)ers tlp tt) 'n'.
(B) Explain string data type. Also explain conrnlon tirnctions provided by string 05
library (like len0, count0, llld0, replaceQ, etc).
olr
(B) \,Vrite a python !)l-o{r-lrrr t1r ptinlitibonacci s'r-ics ol'u' numbers, tvhcre n is 05
givtir hi titc ptrrgr'.ttttttllt.
Branch: CSE/IT
Total Marks:-40
Ir,t!,1 i li I

Partial preview of the text

Download Python Programming LECTURE NOTES and more Lecture notes Programming Languages in PDF only on Docsity!

Enrolment Number:

PARUL UNIVET{StTY

FACULTY OF ENGTNEERING & TECHNOLOGY

B.TECH MtD SEM EXAMINATION

3"d SEMESTER ACY-2022- Python Programming^ (203^ 10521 1)

Date: 0510812022 Time: 2.30 PM to 4.00 PM

Sr. No.. Marks

Q.l (A)^ One line^ Questions 05

1. Define indentation in python.

2. How can we conveft a string to an int in python?

. 3.^ What^ will^ be^ the output^ of^ the^ following^ code snippet?

print(type(5 // 2))

print(type(5 / 2))

4. Hor,v can .ve comment in python program?

" 5. What is an identifier?

(B) CompLrlsory Question 05

1. '*' operator is called operator when used with strings.

2. What will be the value of the fbllowing Python expression?

3. lcn() retLrrns oFstring.

4. Define Fr-rnction.

5. ,Vhy do we Lrse break keyr.vord?

Q.2 Atternpt^ any^ four(Short^ Questions) tz

(l) What are operators'? tixplain arithrnctic opdrators.

(2) F)xplain recursion r,vith suitable ei:iimple.

(3) Explain^ about^ string slioing with^ exanrples.

(4) What is the outpLrt of the ibllor,ving code snippet?

prinr(2+3 + (19 ll 6)*(l + I))

(5) Define lambda furrction with suitable example.

Q.3 Attempt^ any^ two^08

(l) What are applications oIPytho;'r Programnting? Which python iCes are used by

yoLr?

(2) What is a user-defined firrrction'? Explairr with suitable examples

(3) Flxpiain if'-else conditional [rlocir. Writr: a python pro{rarn that reads a number

and chccl<s if'the no is positivu ()r nugativo.

Q.4 (A)^ Ex;ilain^ the tlor,v^ ot''tbr'^ loop and^ 'r,vhile'^ ioop.^ Writc^ a^ python program to^ print^05

sur.Il ol'even ntltub)ers tlp tt) 'n'.

(B) Explain string data type.^ Also explain^ conrnlon tirnctions provided by string 05

library (like len0, count0, llld0,^ replaceQ, etc).

olr

(B) ,Vrite a python !)l-o{r-lrrr t1r^ ptinlitibonacci s'r-ics ol'u' numbers, tvhcre n is 05

givtir hi titc ptrrgr'.ttttttllt.

Branch: CSE/IT

Total Marks:-

Ir,t!,1 i li I