Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
145 views

Python 3 Handson

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)
145 views

Python 3 Handson

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
You are on page 1/ 2

fibonnaci series

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


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

console.log(fibonacci_series(8));

Drop down country field

function runList() {
var select = document.getElementById("list");
var newOption = document.createElement("option");

newOption.text = document.getElementById("txtbox").value;
select.add(newOption);
}

Generate random character

function stringGen() {
var text = "";
var len = document.getElementById("num").value;
var char_list =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < len; i++) {
text += char_list.charAt(Math.floor(Math.random() * char_list.length));
}
document.getElementById("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) {
document.getElementById("screen").value += value;
}

function result(value) {
document.getElementById("screen").value =
eval(document.getElementById("screen").value);
}

function form_reset() {
document.getElementById("screen").value = '';
}

Pthon hands on link


https://www.tejatechview.com/2021/07/python-3-programming-hands-on-solutions.html?
m=1

You might also like