in tnis iab, you aaa a 1oop ana tne statements tnat maKe 1 up the loop body to a Python program. When completed, the program should calculate two totals: the number of 2 LeftOrRight.py - This program calculates the total number of left-handec 3 right-handed students in a class. 4 Input: L for left-handed; R for right handed; X to quit. left-handed people and the number of right-handed 5 Output: Prints the number of left-handed students and the number of righ people in your class. Your loop should execute until the students. user enters the character X instead of a L for left- handed or a R for right-handed. 7 8 rightTotal = 0 # Number of right-handed students. 9 leftTotal = 0 # Number of left-handed students. The inputs for this program are as follows: R, R, R, L, L, L, R, L, R, R, L, X. 10 11 leftOrRight = input("Enter an L if you are left-handed,a R if you are ri or X to quit.") Note that variables have been assigned for you, and the 12 13 # Write your loop here. 14 input and output statements have been written for you. |15 # Output number of left or right-handed students. 16 print("Number of left-handed students: " + str(leftTotal)) 17 print("Number of right-handed students: " + str(rightTotal)) Instructions 1. Make sure the file LeftOrRight.py is selected and 18 open. 2. Write a loop and a loop body that allows you to calculate a total of left-handed and a total of right- handed people in your class. 3. Execute the program using the Run bottom at the bottom of the screen. Input the data listed above and verify that the output is correct.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
in this lab, you aaa a loop ana tne statements tnat make
up the loop body to a Python program. When completed,
2 LeftOrRight.py - This program calculates the total number of left-handec
3
right-handed students in a class.
L for left-handed; R for right handed; X to quit.
5 Output: Prints the number of left-handed students and the number of righ
the program should calculate two totals: the number of
4 Input:
left-handed people and the number of right-handed
people in your class. Your loop should execute until the
students.
user enters the character X instead of a L for left-
6 II IIII
handed or a R for right-handed.
8 rightTotal = 0
9 leftTotal = 0
# Number of right-handed students.
# Number of left-handed students.
The inputs for this program are as follows: R, R, R, L, L, L, R,
10
L, R, R, L, X.
11 leftOrRight = input("Enter an L if you are left-handed, a R if you are ri
or X to quit.")
Note that variables have been assigned for you, and the
12
13 # Write your loop here.
14
15 # Output number of left or right-handed students.
| 16 print("Number of left-handed students: "
'17 print("Number of right-handed students: " + str(rightTotal))
input and output statements have been written for you.
Instructions
+ str(leftTotal))
1. Make sure the file LeftOrRight.py is selected and
18
open.
2. Write a loop and a loop body that allows you to
calculate a total of left-handed and a total of right-
handed people in your class.
3. Execute the program using the Run bottom at the
bottom of the screen. Input the data listed above and
verify that the output is correct.
Grading
Transcribed Image Text:in this lab, you aaa a loop ana tne statements tnat make up the loop body to a Python program. When completed, 2 LeftOrRight.py - This program calculates the total number of left-handec 3 right-handed students in a class. L for left-handed; R for right handed; X to quit. 5 Output: Prints the number of left-handed students and the number of righ the program should calculate two totals: the number of 4 Input: left-handed people and the number of right-handed people in your class. Your loop should execute until the students. user enters the character X instead of a L for left- 6 II IIII handed or a R for right-handed. 8 rightTotal = 0 9 leftTotal = 0 # Number of right-handed students. # Number of left-handed students. The inputs for this program are as follows: R, R, R, L, L, L, R, 10 L, R, R, L, X. 11 leftOrRight = input("Enter an L if you are left-handed, a R if you are ri or X to quit.") Note that variables have been assigned for you, and the 12 13 # Write your loop here. 14 15 # Output number of left or right-handed students. | 16 print("Number of left-handed students: " '17 print("Number of right-handed students: " + str(rightTotal)) input and output statements have been written for you. Instructions + str(leftTotal)) 1. Make sure the file LeftOrRight.py is selected and 18 open. 2. Write a loop and a loop body that allows you to calculate a total of left-handed and a total of right- handed people in your class. 3. Execute the program using the Run bottom at the bottom of the screen. Input the data listed above and verify that the output is correct. Grading
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY