This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Networking service enables users to control the name assigned to ports by the internal DNS. | |
To enable this functionality when you have deployed the openstack using kolla-ansible, do the following to override the exsting configuration: | |
1.Edit the /etc/kolla/config/neutron.conf file and assign a value different to openstacklocal (its default value) to the dns_domain parameter in the [default] section. As an example: | |
``` | |
[DEFAULT] | |
dns_domain = example.org. | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openstack stack create -t a.yaml namrata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pig_latin_sentence(sentence): | |
VOWELS = "aeiou" | |
new_sentence = [] | |
for word in sentence.split(): | |
consonants = 0 | |
if word[0].lower() in VOWELS: | |
new_sentence.append(word + 'yay') | |
continue | |
for letter in word.lower(): | |
if letter not in VOWELS: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stockBuySell(stock_list): | |
buy = stock_list.index(min(stock_list)) +1 | |
sell = stock_list.index(max(stock_list)) +1 | |
return f'buy on day {buy}, sell on day {sell}' | |
if __name__ == '__main__': | |
stock_list = [110, 180, 260, 40, 310, 535, 695] | |
print(stockBuySell(stock_list)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def numChars(string, word): | |
count = 0 | |
for i in list(string): | |
if word in i: | |
count+= 1 | |
print(count) | |
numChars("oh heavens", "h") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def median(list1): | |
length = len(list1) | |
list1.sort() | |
if length %2 == 0: | |
median1 = list1[length//2] | |
median2 = list1[length//2 - 1] | |
median = (median1 + median2)/2 | |
else: | |
median = list1[length//2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self,data): | |
self.data = data | |
self.next = None | |
class LinkedList: | |
def __init__(self): | |
self.head = None | |
def sortedInsert(self, new_node): | |
if self.head is None: | |
new_node.next = self.head |