Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C.S. DIGITAL ASSIGNMENT-4 QUESTIONS Q1. Define a function to print an element ,a tuple and a dictionary of variable arguments using * and **. Q2.

image text in transcribed

C.S. DIGITAL ASSIGNMENT-4 QUESTIONS Q1. Define a function to print an element ,a tuple and a dictionary of variable arguments using * and **. Q2. Define a function to print multiple elements by passing only a single actual/informal argument containing all the elements. Q3. Write a function to display sum of odd and even nos upto a given no. using recursion. Q4. Write a function to display whether the inputted no. is a prime no. or not. Q5.Define a function using recursion to print factorial of a given no. Q6.Define a function to copy the data of a file into another file called "welcome.txt". Q7. Create a file consisting of 10 lines of text and print its 5th line, 6th line, total no. of lines, words and spaces. Also print the words which start with alphabet "s or e using regular expressions. Q8. Write a program to insert a text in the 3rd line of a file containing 7 lines. Q9. Ram is planning to give chocolates to two of his brother. He comes to a shop that has 'n' chocolates of type 1 and 'm' chocolates of type 2, and Ram wants to buy largest but equal no. of both. Write a program to determine the no. using recursive function. Q10.Write a program check if a file is closed or not and also print the name and access mode of the file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions