subject

In Python please.
Alice travels a lot for her work. Each time she travels, she visits a single city before returning home.
Someone recently asked her "how many different cities have you visited for work?" Thankfully Alice has kept a log of her trips. Help Alice figure out the number of cities she has visited at least once.
Input:
The first line of input contains a single positive integer T <_ 50 indicating the number of test cases. The first line of each test case also contains a single positive integer n indicating the number of work trips Alice has taken so far. The following n lines describe these trips. The ith such line simply contains the name of the city Alice visited on her i th trip.
Alice's work only sends her to cities with simple names: city names only contain lowercase letters, have at least one letter, and do not contain spaces.
The number of trips is at most 100 and no city name contains more than 20 characters.
Output:
For each test case, simply output a single line containing a single integer that is the number of distinct cities that Alice has visited on her work trips.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:50
Which are steps taken to diagnose a computer problem? a) reproducing the problem and using error codes b) reproducing the problem and troubleshooting c) using error codes and troubleshooting d) using error codes and stepping functions
Answers: 1
question
Computers and Technology, 24.06.2019 18:00
Why is a multiview sketch drawinf different from other sketches like isometric, two point, and oblique
Answers: 1
question
Computers and Technology, 25.06.2019 10:50
4.9: population write a program that will predict the size of a population of organisms. the program should ask the user for the starting number of organisms, their average daily population increase (as a percentage, expressed as a fraction in decimal form: for example 0.052 would mean a 5.2% increase each day), and the number of days they will multiply. a loop should display the size of the population for each day. prompts, output labels and messages.the three input data should be prompted for with the following prompts: "enter the starting number organisms: ", "enter the daily increase: ", and "enter the number of days the organisms will multiply: " respectively. after the input has been read in successfully, a table is produced, for example: 2 300.0 4 675.0 under the heading is a line of 29 dashes followed by one line for each day, showing the day number and the population at the beginning of that day. input validation.do not accept a number less than 2 for the starting size of the population. if the user fails to satisfy this print a line with this message "invalid. must be at least 2. re-enter: " and try to read the value. similarly, do not accept a negative number for average daily population increase, using the message "invalid. enter a non-negative number: " and retrying. finally, do not accept a number less than 1 for the number of days they will multiply and use the message "invalid. enter 1 or more: ".
Answers: 1
question
Computers and Technology, 25.06.2019 18:30
When a relationship is specified, related records will be displayed in a form's a. column. b. datasheet. c. table. d. subdatasheet.
Answers: 1
You know the right answer?
In Python please.
Alice travels a lot for her work. Each time she travels, she visits a single...
Questions
question
Computers and Technology, 22.03.2021 02:10
question
Mathematics, 22.03.2021 02:10
question
Spanish, 22.03.2021 02:10
question
Chemistry, 22.03.2021 02:10
question
Mathematics, 22.03.2021 02:10
Questions on the website: 13722360