0% found this document useful (0 votes)
187 views2 pages

Python Programming Tutorial

This document outlines a tutorial on Python application programming, including explaining skills needed for programming, data types, operators, functions, errors, variables, loops, strings, files, and exceptions. It provides examples of Python programs to calculate averages, find maximum/minimum values, generate Fibonacci series, and extract data from text files. Students are instructed to write Python code to demonstrate various concepts like conditional execution, parameters in functions, string slicing, reading/writing files, and handling exceptions.

Uploaded by

ash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
187 views2 pages

Python Programming Tutorial

This document outlines a tutorial on Python application programming, including explaining skills needed for programming, data types, operators, functions, errors, variables, loops, strings, files, and exceptions. It provides examples of Python programs to calculate averages, find maximum/minimum values, generate Fibonacci series, and extract data from text files. Students are instructed to write Python code to demonstrate various concepts like conditional execution, parameters in functions, string slicing, reading/writing files, and handling exceptions.

Uploaded by

ash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

||Jai Sri Gurudev||

S.J.C Institute of technology, Chickballapur


Department of Information Science and Eng.
Sub : Python Application Programming [15CS664]
Tutorial – 1
1. Explain the following:
i) Skills necessary for a programmer
ii) Interactive mode
iii) Short circuit evaluation of expression
iv) Modulus operator
2. List the features of python programming language.
3. Demonstrate three types of errors encountered in python programs and predict the out and
justify your answer for following.
i) In a print statement, what happens if you leave out one of the parentheses, or both?
ii) primt (‘hello world’)
iii) I hate you python
4. List the rules to declare a variable in python. Demonstrate at least three different types of variables uses
with an examples and also explain the rules of precedence.
5. Describe python language support for arithmetic, logical, assignment, identity and membership
operators. Write a python program ,if you run a 10 kilometer race in 42 minutes 42 seconds, what
is your average pace (time per mile in minutes and seconds)? What is your average speed in
miles per hour?

6. Explain the concept of conditional execution, alternate execution and chained conditions with
suitable examples.

7.Write a python program to find the best of two test average marks out of three test’s marks
accepted from the user.

8. What are user defined functions? How can we pass parameters in user defined functions?
Explain with suitable example.

9. Write a python program to create a user defined function to find maximum and minimum
letter in string. Also find the length the string without using inbuilt function.

10. Explain the concept of type conversion functions and math functions in python with
examples.

11. How python handles the exceptions? Explain with an example program.

12. Write a single user defined function named ‘Solve’ that returns the remainder and quotient on
division of two numbers accepted from the user. Print the remainder and quotient separately on
the console.
13. Explain the working of while, for and range loop in python write a program to generate
Fibonacci series up to the given limit by defining FIBONACCI(n) function.

14. Write a python program to demonstrate counting, summing and average of elements using
loops

15. Demonstrate the use of break, continue and pass keywords in looping structures. Write a
program to compute only even numbers sum within the given natural number using continue
statement.

16. Define a string. How it can be traversed though using looping statement? Write a python
program to display presence of given substring in main string.

17. List and explain built in string manipulation functions supported by python.

18. Explain string slicing and slicing operator in python. Write a python code to display the last
six characters of the string “Make hay while the sun shines” to the console.

19. Explain fileopen, fileclose, fileread and filewrite concepts in python with example.

20. Write a python program to accept a file name from the user:

i) Display the first N-lines of the file.

ii) Find the frequency of occurrence of the word accepted from the user in the file.

21. How computational fault or computational errors are handled in python? Show it with an
example python program to copy all lines beginning with vowels from FROM.txt file to
VOWEL.txt file retaining other lines.

22. Write a program to prompt for a file name, and then read through the file and look for lines
of the form: X-DSPAM-Confidence:0.8475
When you encounter a line that starts with “X-DSPAM-Confidence:” pull apart the line to
extract the floating point number on the line. Count these lines and then compute the total of the
confidence values from these lines. When you reach the end of the file, print out the average
confidence.

You might also like