1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
babymother [125]
3 years ago
10

I am writing a Python code to ask a user to enter students' information including name,

Computers and Technology
1 answer:
White raven [17]3 years ago
7 0

Answer:

student_file = {}

endf_input = '1'

for x in iter(list, 1):

   name = input("Enter a student name: ")

   st_id = int(input("Enter a student id number: "))

   student_file[name] = st_id

   endf_input = input("Add more student to file (type 1 for yes and 0 to end): ")

   if endf_input == '0':

       break

print("Search for Student")

search = int(input("Enter student id: "))

if search == 0:

   print("Sorry, no student with id of zero.")

   quit()

for key, value in student_file.items():

   if value == search:

       print(f"Student name: {key}")

Explanation:

The program source code uses a for loop to continuously add data to the student file dictionary structure but breaks from the loop when a zero is received as input. The program enters search mode and returns the name of the student with the searched id number.

You might be interested in
Designing a mouse to fit well in your hand would demonstrate ..?
mr Goodwill [35]

Answer:

Hi myself Shrushtee.

Explanation:

Your answer is

A) software engineering,

please mark me as brainleist

3 0
3 years ago
Read 2 more answers
Samuel loves playing the violin, but he feels embarrassed after a classmate posts a video on a social networking site making fun
Ksenya-84 [330]

Answer:

Number 1 would be the answer and most safest one to choose.

4 0
4 years ago
Read 2 more answers
10011÷11 binary division​
Nostrana [21]

Answer:

110.01001

Explanation:

it's a repeating decimal

6 0
3 years ago
you can save your work in BlueGriffion using either _____ or _____. A) the format: secondary toolbar, Wysiwing view. B) The form
shusha [124]

Answer:

B

Explanation:

3 0
4 years ago
Please help me with my question ​
Ahat [919]

Answer:

1. Template

2. Name of the website

3. Signature of the instructor

3 0
3 years ago
Read 2 more answers
Other questions:
  • When driving a truck is fuel crucial
    9·1 answer
  • What is the Documenter?
    10·1 answer
  • Pressing the _____ key when entering title text in a placeholder creates a new paragraph. BACKSPACE SHIFT DELETE ENTER
    5·1 answer
  • .input devices are pieces of equipment that are used to put data into the computer true or false​
    13·1 answer
  • PLEASE HELP 10 POINTS!!!Click this link to view O*NET’s Work Activities section for Human Resources Managers. Note that common a
    7·2 answers
  • java Two smallest numbers Write a program that reads a list of integers, and outputs the two smallest integers in the list, in a
    6·1 answer
  • What programming language does the LMC 'understand'?
    5·1 answer
  • Ismael is examining a report in Access. He needs to access a view that will be used to examine and change the structure of the r
    9·2 answers
  • Write the pseudocode for a program that will process attendance records of CA students. The students attend college five days a
    13·1 answer
  • What causes the hidden node problem in a wireless local area network (wlan)?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!