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
search
eslint
telegram
amp-html
nunit
depth
angular2-material
apache-spark-mllib
yahoo-finance
saml-2.0
knitr
onclick
maxscript
odoo-8
nfs
github-enterprise
tput
endpoint
nancy
intercom
symbol
package-managers
sar
user-experience
kendo-mobile
epsilon
direct3d11
jboss6.x
dapper-extensions
xcode-ui-testing
pic32
opentk
mql
google-earth
erb
android-sugarorm
biztalk-rule-engine
contacts
installshield-le
fossil
sharding
protege4
alphabetical
openalpr
news
unordered-map
laravel-elixir
dcmtk
wmp
android-ibeacon
chronicle-map
http-request
file-sharing
drupal-theming
wc
textsum
scalding
monkey
filenet
stripe-connect
stax
redbeard-ios
iotivity
flex4.6
kango-framework
libav
crouton-os
atan2
dynamics-nav-2016
iokit
vigenere
ess
include-guards
video-player
opserver
vacuum
jsvc
addressing-mode
linkedin-jsapi
template-deduction
buffering
amslidemenu
scrypt
c++builder-xe5
model-driven-development
ebay-lms
traceability
mantle
http-status-code-410
oracle-enterprise-linux
window-decoration
umra
resharper-6.0
cruisecontrol.rb
eclipse-marketplace
echo3
interop-domino
sifr3
escrow
localizable.strings
information-management
wcf-proxy
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