You are on page 1of 1

C Byregowda Institute of Technology

Feb - May 2019 | Python Application Programming (15CS664) | SEM VI


Mrs. Harshitha PR Ms. Suvika KV
Assignment # 01
Date of issue: 23/02/2019 | Submission Due: 08/02/2019

1. List the rule to declare a variable in python. Demonstrate at least three different types of variable uses
with an example program. Explain the rules of precedence used by python to evaluate an expression.
2. List and give syntax of all python supported conditional statements along with its usage.
3. Explain all the errors, void and fruitful functions.
4. Explain the architecture and building blocks of a program. State the need for functions in python.
5. Explain break and continue statements with example program.
6. Define a string. Explain string slicing in Python. Show with examples.
7. Show how to traverse a string using looping statement. Explain “String in Python are immutable”.
8. Explain the following String methods in detail: a) upper( ) b) find( ) C) strip( ) d) lower( ) e)len( ) f)
capitalize( ) g) isalpha( )

1. Write a program which prompts the user for a Celsius temperature, convert the temperature to
Fahrenheit and print out the converted temperature.
2. Write a program to calculate roots of a quadratic equation.
3. Write a Python program to accept a sentence from the user and display the longest word of that
sentence along with its length.
4. Write a python program to display presence of given substring in main string.
5. 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.
6. Write a Python program to read the file and count and print the lines that start with the word “From”.
Prompt the user for the file name. Also use try/except to handle bad file names. Explain format operator
in Python.
7. A number with more than one digit is input through the keyboard. Write Pythonic code to reverse the
digits in the number and find the sum of all the digits in the reversed number.
8. Write Pythonic code to Count and Print the occurrence of each of the word in the file using dictionaries.
Prompt the user for the file name. Also use try/except to handle bad file names.

You might also like