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
android
windows
sonarqube
oracle12c
twig
angular-formly
error-handling
access
xbee
ado.net
regular-language
x264
google-admin-sdk
retrofit2
trac
performancepoint
spin
reactive-programming
siddhi
java.util.logging
gource
dynamic-sql
connector
breadth-first-search
blade
backpack-for-laravel
joptionpane
android-sharedpreferences
outliers
mql
corenlp-server
custom-controls
python-2.6
dst
quickfixj
openwhisk
batching
searchkit
hivemq
apic
tex
css-position
jvmti
odoo-website
chronicle-map
nanoc
ovf
hammer.js
dtsearch
podscms
context-switch
scalding
static-cast
mach-o
java-websocket
taocp
parfor
ng-grid
delta
avspeechsynthesizer
nservicebus5
deep
lz77
nio2
blitline
relativelayout
atan2
custom-errors
rewrite
dock
sony-lifelog-api
baasbox
mirror
aspectj-maven-plugin
j-security-check
public-html
viewer
post-commit-hook
sql-scripts
spy++
human-computer-interface
create.js
codeplex
lnk
functional-java
winginx
ios8-extension
mutual-authentication
multiautocompletetextview
ecslidingviewcontroller
rfc5322
gwt-openlayers
mysql-error-1044
inappsettingskit
ui-select2
wp7test
sqlclr
tree-balancing
redis-py
mkv
saleslogix
thttpd
predicatebuilder
expression-blend-4
user-tracking
uipagecontrol
inline-formset
ie-compatibility-mode
facebook-iframe
jqueryform
sifr
murmurhash
glui
purepdf
scrubyt
java1.4
change-management
mathematical-typesetting

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