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
notepad++
embedded
cheerio
fpga
pyqt
devise
javacc
mips
emscripten
gembox-spreadsheet
zip
missing-data
banner
frontend
vert.x
special-characters
syntaxnet
owin
mel
startup
java.util.logging
jsonpath
stellar.js
flash-player
scrolltop
aws-sdk
mathprog
named-entity-recognition
strongname
mat
entity-relationship-model
8051
soot
spotipy
testcomplete
google-earth
corenlp-server
google-cast
record
database-comparison
wacom
jett
batching
magento-1.9.2.4
imagenet
cd
amazon-ses
metaprogramming
demo
numberpicker
apriori
branching-and-merging
contract
insight
posixct
remedy
qtranslate
static-cast
gpg-signature
objectscript
change-tracking
visual-studio-2008-sp1
chromium-os
angular2-testing
lean
appscale
riot
realsense
forwarding
dock
atoi
liquid-layout
packet-sniffers
angular-gettext
deform
cocos3d
psr-4
cbind
xml-namespaces
xml-dsig
getopt
windows-phone-8-sdk
ice-cube
script#
ui-select2
mantle
fb.ui
uimanageddocument
jdb
koken
kqueue
urlrewriter
relative
expression-blend-4
blender-2.49
echo3
tui
fault-tolerance
commercial-application

Resources

Encrypt Message