Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
28 views
Question Paper Python Sem1 Krishna Gupta
Uploaded by
SHEETAL TANEJA
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Question_paper_python_sem1_Krishna_Gupta For Later
Download
Save
Save Question_paper_python_sem1_Krishna_Gupta For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
28 views
Question Paper Python Sem1 Krishna Gupta
Uploaded by
SHEETAL TANEJA
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Question_paper_python_sem1_Krishna_Gupta For Later
Carousel Previous
Carousel Next
Save
Save Question_paper_python_sem1_Krishna_Gupta For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 7
Search
Fullscreen
[This ques question paper contains 12 printed pages.] Your Roll NoO.....cree0%" Sr. No. of Question Paper: 1546 G Unique Paper Code : 2342011101 Name of the Paper : Programming using Python (DSC-1) Name of the Course + B.Sc. (H) Computer Science Semester ak Duration : 3 Hours Maximum Marks : 90 Instructions for Candidates 1. Write your Roll No. on the top immediately on receipt of this question paper. 2. Section A is compulsory. Attempt any 4 questions from Section B. 4. Parts of a question must be answered together. > PEO.1546 2 1. @) Give the pseudocode or largest of three numbers, @ x/z (i) x+y Gi) [3] (cz Determine the output of following code, State the values of mand sum for all iterations, (3) | n, sum = 371, 0 i while n > 0: sum = sum + (n % 10) ** 3 n=n//10 print(sum) lain 3 Ss vailable for o access modes ® ailable ny two a e ia) Explain anY ae - S ng in python. Use S le examples. file handling P : the following code snippet QB) ne output o} {¢) Determil 2 = ‘ihleD fo ytisrevinU! mysir myStr = myStr(: :-1] print(myStr + “+ '110007') print(len(mySt)) ( Write a function studentData(n), that returns a dictionary with keys as the student roll number and value as student name. The function should accept roll number and name, for m students, as input from the user, Example, the returned dictionary should look like : {101:'Sahir’, 192: 'Sam’,...} (S) PTO;iS uf 1546 4 5 (B) In the iven code snippet, state ont 1546 eo ae Value Qe after execution of each statement a a @o-tey LI = [10, 20, 30,20) = asymmetric_difference(b) L1.append(s0) Gi) © set of Bond) (p, Write a function factors(nt) that returns a set iy, Write a “ L1.remove(20) ‘all the factors of the number nl. print(L1) | ! 1 SECTION B + (L1.extend(‘aroma') ] ene paar) 2. (a) Write a python program which contains the following functions : ” (B) Consider sets a and b: @) @ readflle(file1) that prints the total number a= (5, 12, 33, 14, 55} of lines present in file file. b = {101, 13, 14, 55, 16} Gi) copy(filet, file2) that copies even lines of ‘ t! - Find the value of ¢ for each of the following the file filel in file file2, statements : P.T.O. | Lhe & | RIF he3. (@) Fi Find the output of the fol following code, d= {RED':4, ‘GREEN’; 14, "BLUE. 24} dkeys = list(d.keys()) % print(dkeys[(0}) print("blue’ in d) d['ORANGE'] = 12 d['GREEN’] += 10 print(d) process(stri) that performs the (10) following @ Calculates the frequency of each character ne eee type. print this dictionary. i) Function should return the string which has | the words in the reverse order. Example: if strl = ‘Best of luck Savital’, the function should return the string 'Savita! luck of Best’. 4 ‘ (@) State the value of y after each step: oO ¥ += x{9] + x[-9] P.T.O1546 8 9. Ace 6 7 y <= x[-5] + x13] + 154! y(listh) po =< PP — += x15} + x12] + x2] opy(tist!) es as = e097 OPP ypartition(’ ) we Be a 1ist3(0) = in _§ + “join(y12] split’) 2 Sal 2 yestt2) (0) = 75 5 ns i 1 ind ond justify the values OF listl, list2 a1 =e (Describe the following string functions wi ist es examples = a a @ (b) Generate a list containing the cube of the odd Eo © capitalized) | a | numbers from 1 to m, using = (8) GO isdigitO ( 2 user-defined function myCube(m) be (Gi) upper) (i list comprehension _ Gv) isalpha() B 6. (a) Determine the output of the followi lowing code: = 5. (gf Consider the following set of statements : Se wy=45 oe import copy pos. So um = listl =[ 1, 2, [ 3, 4 - £3, while (y > 0); § P.T.0.fore Z 2) Oves [[ 3) tee 1546 10 : if (y & 1) 1546 grays) sum = sum + x print 133) rax<<1 prin(t-count(7) yry>t ; s2iytol- § prin, 9 [ae miata) 13 = tl + tuple(India’) (®) Write a program that does the following checks | on the age entered by the user: ® © age should not contain alphabets or speci characters (i) age should not be Jess than 21 Raise and handle appropriate exception(s). (@ Compute the output of the following code: th= d, 2, 3.7, 9, 05,7) 12 = (23, [24, 25]) print(t3) (©) Define a class Drone that contains following data (8) members : Instance variables: droneld - id of drone Class variable: totalCount - for keeping count of all the drones manufactured ‘The class should contain the following methods: @ i '—O ~ initialize data members and increment totalCount (i) getldO ~ returns droneld P.T.o.1546 12 (iii) getTotalCount() - returns ‘to (iv) _del_() - to destroy ne decrement the totalCount
You might also like
B. Sc. H Computer S 62VSRUe
PDF
No ratings yet
B. Sc. H Computer S 62VSRUe
6 pages
PYTHON SEM-1
PDF
No ratings yet
PYTHON SEM-1
12 pages
Question Paper Python
PDF
No ratings yet
Question Paper Python
12 pages
Ge Cs question paper
PDF
No ratings yet
Ge Cs question paper
8 pages
GE - Computer Scien LnptIBy
PDF
No ratings yet
GE - Computer Scien LnptIBy
5 pages
Ashish Question Paper
PDF
No ratings yet
Ashish Question Paper
7 pages
Class11_Python_QP
PDF
No ratings yet
Class11_Python_QP
5 pages
Oop With Python Lab
PDF
No ratings yet
Oop With Python Lab
48 pages
Python Final
PDF
No ratings yet
Python Final
11 pages
Class 11 CBSE Computer Science General Practical
PDF
No ratings yet
Class 11 CBSE Computer Science General Practical
15 pages
CSE1012-1
PDF
No ratings yet
CSE1012-1
24 pages
M110-Final Exam Review
PDF
No ratings yet
M110-Final Exam Review
25 pages
B. Sc. H Computer S YA1to4r
PDF
No ratings yet
B. Sc. H Computer S YA1to4r
6 pages
COMPUTER SCIENCE QUESTIONS WITH ANSWERS
PDF
No ratings yet
COMPUTER SCIENCE QUESTIONS WITH ANSWERS
8 pages
Cs Practical
PDF
No ratings yet
Cs Practical
24 pages
CS Assignment
PDF
No ratings yet
CS Assignment
19 pages
Practical Assignment
PDF
No ratings yet
Practical Assignment
9 pages
Sample Paper 11 (1)
PDF
No ratings yet
Sample Paper 11 (1)
4 pages
XI Practical Mannual (3)
PDF
No ratings yet
XI Practical Mannual (3)
3 pages
Python
PDF
No ratings yet
Python
3 pages
easy level practice prgms
PDF
No ratings yet
easy level practice prgms
12 pages
Basic 11th IP Lab Programs
PDF
100% (1)
Basic 11th IP Lab Programs
16 pages
Practical1-12 Sybcs
PDF
No ratings yet
Practical1-12 Sybcs
43 pages
Grade 11 Computer Science HY - QP
PDF
No ratings yet
Grade 11 Computer Science HY - QP
6 pages
Python Lab Programs - Copy
PDF
No ratings yet
Python Lab Programs - Copy
9 pages
File 2 Cs Project
PDF
No ratings yet
File 2 Cs Project
20 pages
Computer Science Project File
PDF
No ratings yet
Computer Science Project File
21 pages
ZF D5 L Qa BPC Fohk JD
PDF
No ratings yet
ZF D5 L Qa BPC Fohk JD
2 pages
PDS Lab Manual - All
PDF
No ratings yet
PDS Lab Manual - All
54 pages
Python Discussed Question
PDF
No ratings yet
Python Discussed Question
22 pages
Fibonacci Series: Pgm:no 1 8/06/2023 Aim
PDF
No ratings yet
Fibonacci Series: Pgm:no 1 8/06/2023 Aim
65 pages
Python Lab File
PDF
No ratings yet
Python Lab File
26 pages
Computer Science Xi Paper PT-1 Hy PT-2 See
PDF
No ratings yet
Computer Science Xi Paper PT-1 Hy PT-2 See
14 pages
GE - Computer Scien 81iXSLh
PDF
No ratings yet
GE - Computer Scien 81iXSLh
6 pages
Tesara lond
PDF
No ratings yet
Tesara lond
47 pages
C Sc Grade 11 QP Annual Exam March 2024_Final
PDF
No ratings yet
C Sc Grade 11 QP Annual Exam March 2024_Final
7 pages
Project Cs(Computer Science)
PDF
No ratings yet
Project Cs(Computer Science)
106 pages
Front+indxxx
PDF
No ratings yet
Front+indxxx
4 pages
PPS 2
PDF
No ratings yet
PPS 2
11 pages
Adjusted_Python_Lab_Solutions
PDF
No ratings yet
Adjusted_Python_Lab_Solutions
4 pages
Computer Science With Python (083) Practical File 2021-2022
PDF
No ratings yet
Computer Science With Python (083) Practical File 2021-2022
19 pages
Practical Main
PDF
No ratings yet
Practical Main
22 pages
Practical Assignment Xi SC (CS) - 2022-23
PDF
No ratings yet
Practical Assignment Xi SC (CS) - 2022-23
8 pages
Practical File
PDF
No ratings yet
Practical File
52 pages
Task 4 Inputs yash kumar 23.51119
PDF
No ratings yet
Task 4 Inputs yash kumar 23.51119
7 pages
CS Class XI Term 2 (2022)
PDF
No ratings yet
CS Class XI Term 2 (2022)
4 pages
Assignments 3 String List Dictionary Functions Recursion Python Programming Bcc402
PDF
No ratings yet
Assignments 3 String List Dictionary Functions Recursion Python Programming Bcc402
9 pages
Final Recordhhhhh
PDF
No ratings yet
Final Recordhhhhh
19 pages
Winter Holidays Home Work-Class-XI-CS
PDF
100% (1)
Winter Holidays Home Work-Class-XI-CS
1 page
python_lab
PDF
No ratings yet
python_lab
19 pages
COMPUTER SCIENCE PROJECT
PDF
No ratings yet
COMPUTER SCIENCE PROJECT
38 pages
CRM Tools
PDF
No ratings yet
CRM Tools
94 pages
Programming Questionsvv
PDF
No ratings yet
Programming Questionsvv
11 pages
computer science practical file khyati kedia
PDF
No ratings yet
computer science practical file khyati kedia
68 pages
Somya - Xii (A) - 60 - CS Practicals
PDF
No ratings yet
Somya - Xii (A) - 60 - CS Practicals
47 pages
New Python
PDF
No ratings yet
New Python
41 pages
Xii - Practicals 24-25
PDF
No ratings yet
Xii - Practicals 24-25
48 pages
URA302 - Python-Programming - URA302 - (Lab - Assignment - 2) .Ipynb at Main Sparsh0106 - URA302 - Python-Programming
PDF
No ratings yet
URA302 - Python-Programming - URA302 - (Lab - Assignment - 2) .Ipynb at Main Sparsh0106 - URA302 - Python-Programming
6 pages