100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

TM111_TMA_02-IT with complete solutions

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
10-02-2023
Written in
2022/2023

Here is an example of how this program could be coded in Python: low_reading_list = [] def green_flag_clicked(): global low_reading_list low_reading_list = [] def space_bar_clicked(): name = input("Enter pupil's name: ") books_read = int(input("Enter the number of books the pupil has read, out of 20: ")) if books_read < 20: low_reading_d(name) green_flag_clicked() space_bar_clicked() print(low_reading_list) Step by step explanation: Detailed explanation: The first line of the code creates an empty list called low_reading_list which will be used to store the names of pupils who have read less than 20 books. The green_flag_clicked() function is defined. This function is called when the Green Flag is clicked in the program. The function uses the global keyword to indicate that it will be modifying the global low_reading_list variable, and then sets the value of low_reading_list to an empty list, effectively clearing it. The space_bar_clicked() function is defined. This function is called when the space bar is clicked in the program. Inside the function, two inputs are asked from the user: name: This is the name of the pupil, entered by the user as a string. books_read: This is the number of books that the pupil has read, entered by the user as an integer. Then there is an if statement which check if the number of books read is less than 20, If it is true then the name of the pupil is added to the low_reading_list using the append() method. Finally, the green_flag_clicked() and space_bar_clicked() functions are called, in that order. The green_flag_clicked() function is called first to clear the low_reading_list The space_bar_clicked() function is called next to prompt the user for the pupil's name and the number of books they've read, and then add the name to the low_reading_list if necessary. At last it prints the low_reading_list Please note that this is just one way of implementing this program and other ways are possible.

Show more Read less
Institution
CLC
Course
CLC









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CLC
Course
CLC

Document information

Uploaded on
February 10, 2023
Number of pages
6
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$17.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
SOARINGHIGH

Get to know the seller

Seller avatar
SOARINGHIGH Phoenix University
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
78
Last sold
-
NURSING TASTE BANKS AND ALL REVISION MATERIALS IN ONE!!!!!!!!!

On this page, you find all documents, package deals, and flashcards i have essential guides that are A graded Here, you will find everything you need in NURSING EXAMS AND TESTBANKS Always leave a review after purchasing any document so as to make sure our customers are 100% satisfied. . I wish you a great, easy and reliable learning through your course and exams. kindly message me for any inquiries or assistance in your studies and i will be of great help. THANKYOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Read more Read less
0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions