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
phantom-dsl
cobalt
eslint
jax-rs
ns-3
hessian
composite-primary-key
pclxl
grafana
permissions
mips
jax-ws
barcode
fabric.io
little-proxy
google-chrome-app
reactive-programming
mod-security
ycsb
frequency-distribution
plink
scrolltop
capistrano3
microsoft-dynamics-nav
firefox-addon
xmonad
user-experience
springfox
backpack-for-laravel
strongname
froala
expressionengine3
itunes
opentk
has-and-belongs-to-many
genexus-sd
paperjs
iis-express
deltaspike
erb
card.io
sharding
mnist
imx6
numpy-broadcasting
latitude-longitude
reason
zoomify
bc
linq-to-objects
apache-stanbol
doc
attributeerror
branching-and-merging
oim
facebook-social-plugins
procfile
getchar
reportservice2010
vugen
twilio-click-to-call
corruption
aquamacs
stdmap
compiler-design
oracleclient
opengl-4
avx
rackspace-cloud
android-instrumentation
vcloud-director-rest-api
redbeard-ios
seek
vulcanize
nikeplus-api
jodd
firebase-security
cfchart
query-by-example
spreadjs
upx
tfs-workitem
flock
binomial-theorem
lasso
apache-commons-daemon
teamcity-9.1
adehabitathr
iiop
structuremap3
rickshaw
genymotion-call
psr-4
imagefilter
insight.database
xml-namespaces
unix-socket
jjaql
jquery-slider
mutual-authentication
radiant
renderer
decoupling
hibernate-entitymanager
light
cnf
ui-select2
dolby-audio-api
windows-98
stacky
alice
bjyauthorize
idn
curb
midlet
fusefabric
exponentiation
twitterizer
eclipse-marketplace
purepdf
visualj#
wcf-proxy
pnrp

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App