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
porting
cobalt
time-complexity
composite-primary-key
jsf-2.2
big-o
visual-studio-emulator
android-json
data-visualization
little-proxy
vimdiff
ibeacon-android
mxgraph
ycsb
angular-dart
renjin
enterprise-architect
standards
user-experience
href
gulp-watch
ember-cli
flask-sqlalchemy
itunes
outliers
android-maps
quantlib
mustache
spring-security4
sammy.js
openerp-7
css-position
chef-solo
setup.py
berkeley-db-je
facebook-social-plugins
dapper-simplecrud
mesosphere
opengl-4
d3-force-directed
ampps
rmongo
simplepie
mapxtreme
envi
drawstring
mapinfo
tooleap
observablecollection
refinerycms
fiware-monitoring
forwarding
flock
intel-c++
text-search
finalbuilder
snackbar
packet-sniffers
jbake
android-vibration
structuremap3
with-statement
verold
alternate
multitasking
rfc5322
visual-studio-express
light
jammer
embedded-fonts
epiceditor
onload-event
mysql-error-2013
dopostback
midlet
saleslogix
faye
boost-signals
subproject
cross-database
hibernateexception
matlab-load
listactivity
google-ajax-api
cgbitmapcontextcreate
objective-j
request-headers
qtabbar
data-mapping
silverlight-oob
web-application-project
dsl-tools
information-management

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