Answer:
The modified program is as follows:
user_input = input()
short_names = list(user_input.split(" "))
short_names.pop(0)
short_names[-1] = "Joe"
print(short_names)
Explanation:
This gets the user input
user_input = input()
This converts input to list
short_names = list(user_input.split(" "))
This removes the first item of the list
short_names.pop(0)
This updates the last item to "Joe"
short_names[-1] = "Joe"
This prints the updated list
print(short_names)
Answer:
a) only one digit changes as the number increases.
Explanation:
Let us first understand what does it mean when we say only one digit changes as the number increases using the Reflected Binary code (also called Gray code)
consider the 4 bit representation of Binary coded decimal and RB codes
Decimal | Binary code | Reflected binary (RB) code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
As you can see in the case of binary codes, there are more than one digit changes between two consecutive numbers.
But notice that in the case of Gray codes, there is always one digit change between two consecutive numbers.
The problem with the binary codes is that the more digits change there states the greater is the chance of ending up with random transitional values rather than real values which can be incorrect. The RB code solves this problem by only changing one digit at a time.
The RB code is widely used in linear and rotary encoders, error correction and digital logic design.
The Round function will do the mentioned operation.
so answer is option C.ROUND
Answer:
find /var -user root > s8
Explanation:
To look for a file matching multiple conditions with find, what you do is to simply list each condition in turn. For instance, to look for a file owned by root (-user root) and writable by its owner (-perm -u+w) on the root filesystem (-xdev, meaning not to recurse underneath mount points such as /proc and /sys) and called hello:
find / -xdev -user root -perm -u+w -name hello
If you're looking for world-writable files, replace -u+w by -a+w. (The - before the permissions means that the file must have at least these permissions; without it find would search for a file that has exactly the distinct permissions.) With GNU find, you can also look for a file that is writable by the user running find: replace -perm -u+w by -writable.
In this case, frame the command as required.
Code: find
Everywhere
code: /
Only directories
code: var
Root owned file
code: - user root
Permission bits
Code: > s8