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
asp.net-web-api
github-for-windows
alexa-skills-kit
babeljs
pkcs#11
arangodb
octave
gson
xcodebuild
php-5.6
spring-social
stellar.js
symmetricds
powershell-v5.0
firefox-addon
video-editing
git-extensions
google-container-registry
pyramid
symfony-console
charles
kendo-mobile
postscript
tosca
froala
maze
stackexchange
jackson-modules
genexus-sd
paperjs
errbot
openmdao
iis-express
winpe
magento-1.8
volatile
linkedhashmap
jwplayer6
servicestack-text
sharepoint-workflow
apiary.io
openerp-7
z-notation
google-data-api
xv6
movilizer
placeholder
avcapturedevice
apache-spark-dataset
stylecop
jquery-ui-draggable
qtranslate
skin
jqchart
bbpress
seq
django-1.10
branch-prediction
restore
juice-ui
usart
flex-monkey
hadoop-2.7.2
webjars
async.js
spring-cloud-feign
rspec2
installshield-2010
sklearn-pandas
fuzzywuzzy
thread-sleep
grass
httpruntime.cache
concurrentmodification
boomerang
opl
dllimport
pax-exam
iced-coffeescript
sha512
fail2ban
grouping-sets
mruby
viewer
easyrtc
nsmenu
with-statement
verold
grails-domain-class
grails-plugin-rabbitmq
ray
ios8-extension
ebay-lms
rolify
tlf
neos-server
node-blade
chart-director
http-status-code-410
mkv
qi4j
boost-msm
window-decoration
apache-commons-dbutils
role
pylucene
collectionviewsource
maven-1
aspmenu
pos-for-.net
murmurhash
cuda.net
sun
wcf-proxy

Resources

Encrypt Message