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
prism
ecmascript-6
pagination
switch-statement
scripting
cq5
nuget-package
crystal-lang
nfs
plist
android-securityexception
ipmitool
stellar.js
renjin
microsoft-dynamics-nav
asp.net-mvc-viewmodel
wolframalpha
swagger-2.0
kendo-mobile
visual-studio-extensions
pimcore
pchart
event-store
short-url
resourcebundle
outliers
nstimer
entity-relationship-model
quantlib
google-earth
magento-1.8
dst
powershell-ise
rselenium
spring-security4
reactjs.net
sharding
sharepoint-workflow
alphabetical
tex
cin
p4merge
escpos
xmldocument
serde
robomongo
insight
custom-font
quicktime
seq
d3-force-directed
cmp
polyline
omxplayer
mongodb-php
simevents
phpwebsocket
halcon
state-restoration
google-books
opserver
coda
toolkit
batik
exceldatareader
infosphere-spl
nodelist
theos
nsmenu
raygun
lnk
functional-java
memset
ecslidingviewcontroller
cocoalibspotify-2.0
cnf
dolby-audio-api
chart-director
pstack
mysql-error-1205
google-ajax-api
silverlight-oob
wordprocessingml
google-wave

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile