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
kupik [55]
3 years ago
10

Which method would you use to get the value associated with a specific key and remove that key-value pair from the dictionary

Computers and Technology
1 answer:
ollegr [7]3 years ago
5 0

Answer:

popitem

items

pop

list

Explanation:

You might be interested in
Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 then the outp
Ainat [17]

Answer:

public class num3 {

   public static String swapValues(int userVal1, int userVal2){

       int temp = userVal2;

       userVal2 = userVal1;

       userVal1 = temp;

       return(userVal1+", "+userVal2);

   }

   public static void main(String[] args) {

       int val1 = 5;

       int val2 = 8;

       System.out.println("Original values");

       System.out.println(val1+", "+val2);

       System.out.println("Swapped Values");

       System.out.println(swapValues(val1,val2));

   }

}

Explanation:

  • The problem is solved with Java programming language
  • Define the method swapValues() to accept two ints and return a String
  • Within the method body, create a temp variable to hold the value of userVal2 temporary
  • Do the following re-assignment of values userVal2 = userVal1; userVal1 = temp;
  • Return the concatenated String userVal1+", "+userVal2
  • Create two variables and initialize them in the main method
  • Output their values
  • Call swapValues() aand output the swapped values
4 0
3 years ago
This question involves the creation of user names for an online system. A user name is created based on a user’s first and last
Evgen [1.6K]

Answer:

See explaination

Explanation:

import java.util.*;

class UserName{

ArrayList<String> possibleNames;

UserName(String firstName, String lastName){

if(this.isValidName(firstName) && this.isValidName(lastName)){

possibleNames = new ArrayList<String>();

for(int i=1;i<firstName.length()+1;i++){

possibleNames.add(lastName+firstName.substring(0,i));

}

}else{

System.out.println("firstName and lastName must contain letters only.");

}

}

public boolean isUsed(String name, String[] arr){

for(int i=0;i<arr.length;i++){

if(name.equals(arr[i]))

return true;

}

return false;

}

public void setAvailableUserNames(String[] usedNames){

String[] names = new String[this.possibleNames.size()];

names = this.possibleNames.toArray(names);

for(int i=0;i<usedNames.length;i++){

if(isUsed(usedNames[i],names)){

int index = this.possibleNames.indexOf(usedNames[i]);

this.possibleNames.remove(index);

names = new String[this.possibleNames.size()];

names = this.possibleNames.toArray(names);

}

}

}

public boolean isValidName(String str){

if(str.length()==0) return false;

for(int i=0;i<str.length();i++){

if(str.charAt(i)<'a'||str.charAt(i)>'z' && (str.charAt(i)<'A' || str.charAt(i)>'Z'))

return false;

}

return true;

}

public static void main(String[] args) {

UserName person1 = new UserName("john","smith");

System.out.println(person1.possibleNames);

String[] used = {"harta","hartm","harty"};

UserName person2 = new UserName("mary","hart");

System.out.println("possibleNames before removing: "+person2.possibleNames);

person2.setAvailableUserNames(used);

System.out.println("possibleNames after removing: "+person2.possibleNames);

}

}

8 0
3 years ago
What are the different types database of end users? Discuss the main activi-ties of each
disa [49]

Answer:

following types of databases available in the market −

Centralised database.

Distributed database.

Personal database.

End-user database.

Commercial database.

NoSQL database.

Operational database.

Relational database.

Cloud database.

Object-oriented database.

Graph database

8 0
3 years ago
Read 2 more answers
Romans are credited with “inventing” the capital city l? T or F
Law Incorporation [45]

Answer:

T

Explanation:

just finished the assignment on edge

5 0
3 years ago
Many of the internal OS services are provided by the ___________ module, which contains the most important operating system proc
patriot [66]

Answer:

Kernal module

Explanation:

Modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system.

6 0
4 years ago
Other questions:
  • What machine is considered by many to be the first all-programmable electronic digital computer?
    15·1 answer
  • .All of the following are true with the respect to implicitinvocation except:
    8·1 answer
  • George writes code for word processing applications. He is looking for a new job opportunity. What position should George look f
    5·2 answers
  • Design a class FileArray that has a static method named writeArray. The method should take two arguments: the name of a file and
    11·1 answer
  • What are the three types of mergers?
    8·1 answer
  • Organizations must protect their sensitive information through digital security measures and their _____ through physical securi
    13·2 answers
  • If you convinced your teacher to give you an extension on an assignment, what would this situation be an example of? OA. General
    8·1 answer
  • A worksheet can have a maximum of number of rows​
    11·2 answers
  • What is computer and example<br>​
    5·1 answer
  • The internet is controlled by ______
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!