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
kentico
twitter-bootstrap-3
awk
codenvy
merge
nvd3.js
dns
android-studio-2.2
datastore
sh
graphics
error-handling
r-googlesheets
seo
zip
sendgrid-api-v3
jquery-ui-sortable
ibeacon-android
xcodebuild
jsonpath
naivebayes
automatic-ref-counting
enterprise-architect
altera
powershell-v5.0
google-container-registry
database-connection
user-experience
short-url
comparator
ckfinder
moses
gpio
fable-f#
appirater
flooding
apktool
intersystems-cache
inversion-of-control
winexe
errbot
cppreference
uitapgesturerecognizer
nsurl
volatile
python-2.6
utorrent
linkedhashmap
hard-drive
gojs
hunspell
sharding
installscript
numpy-broadcasting
imagenet
recurrent-neural-network
loading
health-monitoring
mcustomscrollbar
tasm
ogc
vmware-fusion
levenshtein-distance
ssrs-2014
facebook-social-plugins
snapchat
optimizely
reportservice2010
yii2-user
oracleclient
excel-dna
trigger.io
pybrain
android-instrumentation
sandcastle
pocketsphinx-android
polyline
atlas
beamer
jodd
mapinfo
eigenvector
udpclient
bizagi
boost-serialization
turbo-prolog
redis-cluster
createprocess
database-relations
thread-sleep
grass
invoke-sqlcmd
contentcontrol
mobiledoc-kit
terracotta
oracle-spatial
microsoft-reporting
amiga
canvg
git-ftp
broadband
variadic-templates
dbaccess
entry-point
psr-4
authlogic
ice-cube
nebula
time.h
font-awesome-4.0.0
insert-id
robotlegs
panda3d
saleslogix
inkcanvas
predicatebuilder
wiimote
pinch
automationelement
cgbitmapcontextcreate
cruisecontrol.rb
feasibility
appliance

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App