0% found this document useful (0 votes)
94 views2 pages

Fibonacci Series and Simple Calculator Code

The final document provides a link to a Python programming hands-on solutions page containing examples and exercises for learning Python programming concepts and skills

Uploaded by

Er Priyank Jain
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views2 pages

Fibonacci Series and Simple Calculator Code

The final document provides a link to a Python programming hands-on solutions page containing examples and exercises for learning Python programming concepts and skills

Uploaded by

Er Priyank Jain
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

fibonnaci series

function fibonacciSequence(input) {//Type your code here


if (input===1) {return [0, 1];} else {var s = fibonacciSequence(input -
1);[Link](s[[Link] - 1] + s[[Link] - 2]);return s;}}

[Link](fibonacci_series(8));

Drop down country field

function runList() {
var select = [Link]("list");
var newOption = [Link]("option");

[Link] = [Link]("txtbox").value;
[Link](newOption);
}

Generate random character

function stringGen() {
var text = "";
var len = [Link]("num").value;
var char_list =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < len; i++) {
text += char_list.charAt([Link]([Link]() * char_list.length));
}
[Link]("result").innerHTML = text;
return text;
}

simple calculator
<FORM NAME="myForm">
<TABLE BORDER=2>
<TR>
<TD align="center">
<INPUT TYPE="text" ID="screen" NAME="screen" style="width:99%"><br>
</TD>
</TR>
<TR>
<TD>
<INPUT TYPE="button" NAME="7" VALUE=" 7 " onclick="update(7)">
<INPUT TYPE="button" NAME="8" VALUE=" 8 " onclick="update(8)">
<INPUT TYPE="button" NAME="9" VALUE=" 9 " onclick="update(9)">
<INPUT TYPE="button" NAME="+" VALUE=" + " onclick="update('+')">
<br>
<INPUT TYPE="button" NAME="4" VALUE=" 4 " onclick="update(4)">
<INPUT TYPE="button" NAME="5" VALUE=" 5 " onclick="update(5)">
<INPUT TYPE="button" NAME="6" VALUE=" 6 " onclick="update(6)">
<INPUT TYPE="button" NAME="-" VALUE=" - " onclick="update('-')">
<br>
<INPUT TYPE="button" NAME="1" VALUE=" 1 " onclick="update(1)">
<INPUT TYPE="button" NAME="2" VALUE=" 2 " onclick="update(2)">
<INPUT TYPE="button" NAME="3" VALUE=" 3 " onclick="update(3)">
<INPUT TYPE="button" NAME="*" VALUE=" x " onclick="update('*')">
<br>
<INPUT TYPE="button" NAME="c" VALUE=" c " onclick="form_reset();">
<INPUT TYPE="button" NAME="0" VALUE=" 0 " onclick="update(0)">
<INPUT TYPE="button" NAME="=" VALUE=" = " onclick="result();">
<INPUT TYPE="button" NAME="/" VALUE=" / " onclick="update('/')">
</TD>
</TR>
</TABLE>
</FORM>

function update(value) {
[Link]("screen").value += value;
}

function result(value) {
[Link]("screen").value =
eval([Link]("screen").value);
}

function form_reset() {
[Link]("screen").value = '';
}

Pthon hands on link


[Link]
m=1

You might also like