Answer:
The value of count after the code is executed is 0
Explanation:
According to the code initially the value of count is 10
while (count>0)
{
count=count-2
}
means 10>0 condition is true
count=10-2=8
Again 8>0 condition of while loop is again true
now count becomes=6
This process repeated untill the condition of while loop is true
and at last count becomes 0 the condition is false (0>0) so count becomes 0 after the code segment is executed
<span>it is stored on your clipboard and you can get to it by pressing ctrl+c</span>
Ctrl-alt-del=opens up windows task manager
I think its <tagname> content right here </tag name>
Answer:
Following are the code to this question:
userVal = input()#defining a variable userVal for input the value
x= 0#defining variable x that holds a value 0
for j in userVal:#defining for loop to count input value in number
if not(j in " .,"):#defining if block that checks there is no spaces,periods,and commas in the value
x += 1#increment the value of x by 1
print(x)#Print x variable value
Output:
Hello, My name is Alex.
17
Explanation:
In the above-given code, a variable "userVal" is defined that uses the input method for input the value from the user end, in the next line, an integer variable "x" is defined, hold value, that is 0, in this variable, we count all values.
- In the next line, for loop is defined that counts string value in number and inside the loop an if block is defined, that uses the not method to remove spaces, periods, and commas from the value and increment the value of x by 1.
- In the last step, the print method is used, which prints the calculated value of the "x" variable.