Computer Science
Write a function countNow(PLACES) in Python, that takes the dictionary, PLACES as an argument and displays the names (in uppercase) of the places whose names are longer than 5 characters. For example, Consider the following dictionary:
PLACES = {1: "Delhi", 2: "London", 3: "Paris", 4: "New York", 5:"Doha"}
The output should be:
LONDON
NEW YORK
Related Questions
(i) Define the term bandwidth with respect to networks.
(ii) How is http different from https ?
The code given below accepts a number as an argument and returns the reverse number. Observe the following code carefully and rewrite it after removing all syntax and logical errors. Underline all the corrections made.
define revNumber(num): rev = 0 rem = 0 While num > 0: rem == num % 10 rev = rev * 10 + rem num = num//10 return rev print(revNumber(1234))
Write a function, lenWords(STRING), that takes a string as an argument and returns a tuple containing length of each word of a string. For example, if the string is "Come let us have some fun", the tuple will have (4, 3, 2, 4, 4, 3).
Predict the output of the following code:
S = "LOST" L = [10, 21, 33, 4] D = {} for I in range(len(S)): if I % 2 == 0: D[L.pop()] = S[I] else: D[L.pop()] = I + 3 for K, V in D.items(): print(K, V, sep = "*")