DAY4: ------ 1.if/elif 2.Loopings(for,while) 3.break/continue QUESTIONS(Theory) ------------------ 1.What is difference between break and continue? 2.What is mean by control statments and types? 3.What is mean by for loop? 4.Can you explain about for loop execution process? 5.Difference between for and while loop? 6.Is it possible to use break and continue outside of loop? 7.Write a syntax of for? 8.Write a syntax of while()? 9.Write a syntax of elif? 10.Difference between if-else and elif? QUESTIONS(Find the output) ----------------------- QUESTION 1: ------------ for x in range(1,100): if(x==5): print(x) QUESTION 2: ------------ for x in range(1,100): if(x==5): break print(x) QUESTION 3: ---------- for x in range(1,100): if(x==5): continue print(x) QUESTION 4: ------------ for x in range(1,4): for y in range(1,4): print(y) print(x) QUESTION 5: ------------ for x in range(1,4): for y in range(1,4): print(x) QUESTION 6: ----------- for x in range(1,4): for y in range(1,x): print(y) QUESTION 7: ----------- for x in range(1,4): for y in range(x+1,4): print(y) QUESTION 8: ------------ for x in range(1,4): for y in range(x+1,x): print(y) QUESTION 9: ------------ i=5; if i==5: break; QUESTION 10: ------------ i=5; if i==5: continue QUESTION 11: ------------ for x in range(1,100): if(x==5): print(x) QUESTIONS(Programs) ------------------- QUESTION 1: ----------- Description: Write Python program to allow the user to input his/her age. Then the program will show if the person is eligible to vote. A person who is eligible to vote must be older than or equal 1 to 18 years old. Example: -------- Input = 10 Output = print not eligible. QUESTION 2: ----------- Description: Write a program to find even or odd number Example: --------- Input = 10 Output = Even QUESTION 3: ------------ Description: Write a program to print even number from 1 to 100 Example: --------- Output = 2,4,....100 QUESTION 4: ------------ Description: Find the sum of odd number 1 to 100 Example: -------- Output = 2500 QUESTION 5: ----------- Description: Count of even number 1 to 100 Example: -------- Output = 50 QUESTION 6: ----------- Description: Write a program to find the factorial of a number. Example: -------- Input = 5 Output = 120 QUESTION 7: ------------ Description: Write a program to print the fibonacci series of a number 1 to 100. Example: -------- Output = 0,1,1,2,3,5.....