0% found this document useful (0 votes)
8 views1 page

Day9 DailyAssignmentPDF

The document outlines an in-class assignment focused on control flow and loops in programming. It includes tasks related to conditional statements, loops, loop control statements, the ternary operator, and case statements, with specific programming challenges for each category. The assignment aims to enhance students' understanding of these fundamental programming concepts.

Uploaded by

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

Day9 DailyAssignmentPDF

The document outlines an in-class assignment focused on control flow and loops in programming. It includes tasks related to conditional statements, loops, loop control statements, the ternary operator, and case statements, with specific programming challenges for each category. The assignment aims to enhance students' understanding of these fundamental programming concepts.

Uploaded by

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

Day 5: In-Class Assignment Questions (Control Flow & Loops)

1. Conditional Statements

• 1.1: Write a program to determine the grade of a student based on their marks
(e.g., A for 90-100, B for 80-89, etc.). Use if-elif-else.

• 1.2: Create a program to check if a given number is within a specified range (e.g.,
between 10 and 20).

• 1.3: Implement a simple game of rock-paper-scissors using if-elif-else to


determine the winner.

2. Loops

• 2.1: Write a program to print the first 15 multiples of a given number using a for
loop.

• 2.2: Create a program to find the sum of all odd numbers between 1 and 50 using
a while loop.

• 2.3: Write a program to print the Fibonacci sequence up to a certain limit using a
while loop.

3. Loop Control Statements

• 3.1: Write a program to find the sum of all numbers in a list, excluding any
negative numbers using the continue statement.

• 3.2: Create a program to search for a specific character in a string and print its
index. Use the break statement to exit the loop once the character is found.

4. Ternary Operator

• 4.1: Write a program to check if a given number is even or odd using the ternary
operator.

5. Case Statement (if available in your Python version)

• 5.1: Write a program to convert a month number (1-12) to its corresponding


month name using the match-case statement.

Karnataka, Bangalore, 560049


Phone: +91 97419 82589, +91 97318 52489
Web site: aipoch.ai, mind2i.com

You might also like