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
1) Input - to be done in main() Prompt the user for and input the number of units. Prompt the user for and input the amount for
denis-greek [22]

Answer:

#include <iostream>

using namespace <std>;

double calcTuition(double units, double studentFees);

void output(double total);

int main{

   double unitCost, schoolFees, total;

   cin >>"Enter unit cost: " >> unitCost;

   cin >>"Enter school fees: " >> schoolFees;

   total = calcTuition( unitCost, schoolFees );

   output( total );

}

double calcTuition(double units, double studentFees){

   return unit * studentFees;

}

void output(double total){

   cout << " Total: " << total;

}

Explanation:

The C++ console source code prints out the total cost of a student's tuition. The student is prompted to input the units and the school fees and the total is displayed excluding parking fees.

8 0
3 years ago
Is it true that if the user log out the computer will turn off automatically​
sergiy2304 [10]
Yes that is a true statement
8 0
3 years ago
Read 2 more answers
What are two characteristics of switches? (Choose two.) * 1 point A. Switches identify the intended destination of the data that
tigry1 [53]

Answer:

A. Switches identify the intended destination of the data that they receive. And C. Switches are capable of sending and receiving data at the same time

Explanation:

Switches can be used as inputs (Analog), or outputs (digital). These inputs and outputs are signals that the switches send or receive- Or at least as push button switches... But the same applies to network switches.

Hope this helps! Have a great day!

7 0
3 years ago
USB flash drives are small portable units that are used to ____________files.
Juliette [100K]

Answer:D

Explanation: they do all of these

3 0
4 years ago
Read 2 more answers
Is it possible to build something that doesn't exist yet?
Anastasy [175]

Answer:

yes

Explanation:

how do u think other thing were built like when phones were first made

5 0
3 years ago
Other questions:
  • The______for our newest game keeps changing as we develop our concept and refine our goals.
    11·2 answers
  • Why would a designer choose to use an isometric sketch rather than a perspective sketch to share their idea with a design team m
    14·1 answer
  • The algorithm ADDN implements N-bit fixed-width binary addition for non-negative integers and ignores overflows. For example, AD
    13·1 answer
  • PLS ANSWER QUICK!!!!
    12·1 answer
  • How many questions do you need to have on brainly before being able to send messages?
    14·1 answer
  • I need help with this
    12·1 answer
  • According to a case study in one of our weekly chapter reading, nearly..................... percent of all employees send work e
    11·2 answers
  • Clocks (also called timers) are essential to the operation of any multiprogrammed system. They maintain the time of day, and pre
    9·1 answer
  • 9 Which of these words is used to begin a conditional statement? ​
    8·1 answer
  • How can you have internet without subscribing to cable?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!