grok


Grok Learning - 'Halve This'


I am having trouble solving the 'Halve This' problem on Grok Learning.
My code so far is:
x = int(input('Number: ')
f = float(x)
h = (f/2)
print(h)
But Grok is saying that the "f = float(x)" is incorrect. This message appears when I try to run the code:
File "program.py", line 2
f = float(x)
^
SyntaxError: invalid syntax
Can someone please tell me what is wrong or at best tell me the entire solution. This would be highly appreciated.
As #David Young said, try adding parenthesis on the first line.
x = int(input('Number: '))
f = float(x)
h = (f/2)
print(h)
you can also solve this without converting to float.
x = int(input('Number: '))
h = (f/2)
print(h)

Related Links

Grok Learning - 'Halve This'
logstash grok patterns assistance
Using multiple grok pattern to assign value to 1 field
Graylog cannot look a field as numeric
Logstatsh help needed to write grok filter
How to have timestamp as the only delimiter in Grok Logstach?
Error compiling Grok
logstash grok filter annoyance

Categories

HOME
design-patterns
jsf-2.2
error-handling
ms-access-2016
carousel
gembox-spreadsheet
flume
elasticsearch-5
mql5
g++
categorical-data
activecollab
rtf
cumulocity
heat
altera
package-managers
screen-readers
atlassian-stash
google-data-studio
sse
exploit
tosca
epsilon
monit
custom-post-type
entity-relationship-model
apktool
gp
tizen-tv
aws-codecommit
cart
jett
android-gridview
nested-lists
installscript
zoomify
gdata
css-position
clang++
plan-9
getchar
yii2-api
rserve
payara-micro
seq
janus
monkey
gameplay-kit
javafx-css
neon
dimension
mediametadataretriever
query-by-example
gcloud-ruby
grgit
dllimport
vacuum
baasbox
canvg
uvc
broadband
mmwormhole
cocos3d
human-computer-interface
malformedurlexception
android-framework
breakout
scringo
apache-abdera
twisted.web
listitem
koken
matlab-load
update-statement
mysql-error-1205
strsep
event-receiver
xui
socketserver
spread
silverlight-oob
interop-domino
application-planning
xslcompiledtransform
change-management

Resources

Encrypt Message