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
assembly
facebook-oauth
turing-machines
cheerio
merge
rom
echo
x264
vsm
data-visualization
angularfire2
computer-science
bing-maps
mel
angular-dart
nancy
gource
symfony-2.8
chargify
google-container-registry
boost-icl
replication
imagemap
licensing
jasmine-node
datastax-enterprise-graph
google-cast
hibernate-validator
git-squash
papaparse
jett
browser-extension
getlasterror
python-pptx
apic
tex
android-augmented-reality
sim-card
bc
metaprogramming
google-data-api
opensmpp
glm-math
claims
lpsolve
rfc3339
facebook-social-plugins
sonarlint-eclipse
yii2-api
mschart
payara-micro
wpas
avx
type-theory
restore
stax
drawstring
riot
bizagi
exim4
phpgrid
themoviedb-api
microsoft-reporting
video-player
extjs-grid
visual-sourcesafe-2005
mod-proxy
rdflib
google-refine
fail2ban
webmatrix-3
ghcjs
tweenlite
xml-namespaces
ss7
windows-embedded-standard
gtm-oauth2
unit-of-work
ui-select2
nebula
superscrollorama
redis-py
mkv
xcode3.2
faye
extconf.rb
fusefabric
jdb
oracle-enterprise-linux
failing-tests
jquery-address
exponentiation
webdev.webserver
http-daemon
timertask
facebook-iframe
globals
interprocess
openfaces
opml
cuda.net
software-lifecycle
wysiwym
dsoframer
wspbuilder

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