Page 1 of 1

Q: Solve the following questions: 1. What is the output of the following program? i = 1 while i < 5: print('The value of

Posted: Thu May 26, 2022 9:49 am
by answerhappygod
Q Solve The Following Questions 1 What Is The Output Of The Following Program I 1 While I 5 Print The Value Of 1
Q Solve The Following Questions 1 What Is The Output Of The Following Program I 1 While I 5 Print The Value Of 1 (32.74 KiB) Viewed 14 times
Q: Solve the following questions: 1. What is the output of the following program? i = 1 while i < 5: print('The value of i is: {}'.format(i)) i=i+1 else: print('Exit loop') 2. Write a program to print square of the numbers from a list using for loop. 3. Write a detail note on range() function. 4. What is the benefit of pass statement to use with a loop? 5. For function definition if you don't know the number of arguments. What is the solution? 6. Write down the difference between argument and parameter. 7. Write down a program which add two numbers using function. 8. What happens if a function does not have any body? 9. Write a program to show how break statement works? 10. What is the purpose of continue statement?